Game.Objects.Pillar
Assembly:
Namespace: Game.Objects
Type: struct
Base: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary: Pillar is an empty (marker/tag) ECS component used to mark entities as "pillars" within the game's entity-component system. The struct is explicitly laid out with Size = 1 to ensure a non-zero size in memory/serialization. Implementing IComponentData makes it an ECS component; IQueryTypeParameter allows it to be used in query type parameters; IEmptySerializable indicates support for Colossal's empty-type serialization. This type contains no payload — presence (or absence) of the component is the information.
Fields
- (none)
This struct contains no instance fields by design; it serves as a tag component.
Properties
- (none)
No properties are defined.
Constructors
public Pillar()
As a value type (struct) Pillar has the implicit parameterless default constructor. You generally create or add it to an entity as a tag (no data to initialize).
Methods
- (none)
There are no methods defined on this type. Its purpose is purely to act as an empty/component marker.
Usage Example
// Using an EntityManager to add the tag to an entity:
entityManager.AddComponent<Pillar>(entity);
// Or (older API) add an instance (empty) as component data:
entityManager.AddComponentData(entity, new Pillar());
// Check whether an entity has the tag:
bool isPillar = entityManager.HasComponent<Pillar>(entity);
// Querying entities that have the Pillar tag in a SystemBase:
Entities
.WithAll<Pillar>()
.ForEach((Entity e) =>
{
// operate on pillar entities
}).Schedule();
// Alternatively, removing the tag:
entityManager.RemoveComponent<Pillar>(entity);
Additional notes: - Because Pillar implements IEmptySerializable and the struct is marked with StructLayout(Size = 1), it is intended to be efficiently serialized/deserialized by Colossal's serialization system even though it carries no data. - Use this component when you only need to mark entities for filtering or behavior branching (tags) rather than storing per-entity data.