Game.Citizens.LodgingSeeker
Assembly:
Game
Namespace: Game.Citizens
Type: struct
Base: System.ValueType, implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable
Summary: LodgingSeeker is a marker (empty) ECS component used to tag citizen-related entities that are actively seeking lodging. It is defined with a fixed layout and size of 1 byte so it can be serialized and stored efficiently by the game's custom serialization systems. As an empty component it carries no data—presence/absence is used to drive behavior in systems and queries.
Fields
- This struct declares no instance fields. This type is intentionally empty; the StructLayout(Size = 1) attribute guarantees a non-zero size for serialization and memory layout purposes.
Properties
- This type exposes no properties. Being an empty marker component, it does not provide any runtime properties.
Constructors
public LodgingSeeker()
Structs have an implicit parameterless constructor. No explicit constructors are declared in source.
Methods
- This type declares no methods. Behavior is defined by systems that query for the presence of this component. The implemented interfaces (IComponentData, IQueryTypeParameter, IEmptySerializable) are marker/serialization/query-related and do not add instance methods here.
Usage Example
// Add the marker to an entity (EntityManager example)
var lodgingSeeker = new LodgingSeeker();
entityManager.AddComponentData(entity, lodgingSeeker);
// Query for entities that are lodging seekers
Entities
.WithAll<LodgingSeeker>()
.ForEach((Entity e, in SomeOtherComponent comp) =>
{
// handle entities that are seeking lodging
});
Additional notes: - The attribute [StructLayout(LayoutKind.Sequential, Size = 1)] ensures a predictable, minimal memory footprint and compatibility with the game's serialization pipeline. - Use this component as a boolean flag in ECS systems—remove it when the citizen no longer seeks lodging.