2023-10-19 22:41:49 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace MoonTools.ECS.Rev2
|
|
|
|
{
|
|
|
|
public class Archetype
|
|
|
|
{
|
|
|
|
public ArchetypeSignature Signature;
|
|
|
|
public ArchetypeId Id { get; private set; }
|
|
|
|
public List<Column> Components = new List<Column>();
|
2023-10-20 00:41:45 +00:00
|
|
|
public List<EntityId> RowToEntity = new List<EntityId>();
|
2023-10-21 00:24:35 +00:00
|
|
|
|
|
|
|
public Dictionary<ComponentId, int> ComponentToColumnIndex =
|
|
|
|
new Dictionary<ComponentId, int>();
|
2023-10-20 08:17:03 +00:00
|
|
|
public SortedDictionary<ComponentId, ArchetypeEdge> Edges = new SortedDictionary<ComponentId, ArchetypeEdge>();
|
2023-10-19 22:41:49 +00:00
|
|
|
|
2023-10-24 20:13:14 +00:00
|
|
|
public int Count => RowToEntity.Count;
|
2023-10-19 22:41:49 +00:00
|
|
|
|
|
|
|
public Archetype(ArchetypeId id, ArchetypeSignature signature)
|
|
|
|
{
|
|
|
|
Id = id;
|
|
|
|
Signature = signature;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|