Game.DisasterFacility
Assembly: Assembly-CSharp.dll
Namespace: Game.Buildings
Type: struct
Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable
Summary: Marker/flag component used by the game's ECS to identify entities that represent a "disaster facility" building. The struct is empty by design (contains no data) and its primary purpose is to tag an entity so systems and queries can detect and operate on disaster facilities. The StructLayout attribute with Size = 1 ensures the type has a non-zero size for the game's serialization/runtime expectations and compatibility with the Colossal serialization pipeline.
Fields
- (none)
This type declares no instance fields. It is an intentionally empty marker struct; the StructLayout attribute forces a 1-byte size for serialization and memory-layout reasons.
Properties
- (none)
There are no properties. Use the presence/absence of the component to represent state.
Constructors
- (implicit) public DisasterFacility()
Structs have an implicit default parameterless constructor that yields the default value. You typically construct one with "new DisasterFacility()" or use default(DisasterFacility). No explicit constructors are defined in source.
Methods
- (none)
The type implements only marker interfaces (IComponentData, IQueryTypeParameter, IEmptySerializable) and provides no methods. Systems operate on the presence of the component rather than any contained data.
Usage Example
// Add the marker component when creating an entity:
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
EntityArchetype archetype = em.CreateArchetype(typeof(Game.Buildings.DisasterFacility));
Entity facilityEntity = em.CreateEntity(archetype);
// Or add the component to an existing entity:
em.AddComponentData(someEntity, new Game.Buildings.DisasterFacility());
// Query for disaster facilities:
var query = em.CreateEntityQuery(ComponentType.ReadOnly<Game.Buildings.DisasterFacility>());
// In a system (Entities.ForEach style) you can filter by the component:
Entities
.WithAll<Game.Buildings.DisasterFacility>()
.ForEach((Entity e) =>
{
// e is a disaster facility
}).Schedule();