// returns compile-time type T for EntityComponentType enum public static Type GetTypeForComponentType(EntityComponentType type) { switch (type) { case EntityComponentType.Damageable: return(typeof(DamageableComponent)); case EntityComponentType.Selectable: return(typeof(SelectableComponent)); case EntityComponentType.AI: return(typeof(AIComponent)); case EntityComponentType.Capacities: return(typeof(CapacitiesComponent)); // TODO: remove fall through to default case EntityComponentType.Movement: case EntityComponentType.None: default: throw new ArgumentException("EntityManager: queried EntityComponentType is unsupported."); } }
public static EntityComponentsMask Or(this EntityComponentsMask mask, EntityComponentType type) { return(mask | (EntityComponentsMask)(1 << (int)type)); }
protected EntityComponent(EntityComponentType type) { Type = type; }