Game.Prefabs.DisasterFacilityData
Assembly:
Game
Namespace: Game.Prefabs
Type:
struct
Base:
Implements: IComponentData, IQueryTypeParameter, IEmptySerializable
Attribute: [StructLayout(LayoutKind.Sequential, Size = 1)]
Summary:
DisasterFacilityData is an empty marker component used in the game's ECS to identify or mark entities/prefabs that represent disaster facilities. It is a zero-data struct (explicitly given a size of 1 byte via StructLayout) so it can be attached to entities for queries and recognized by the Colossal serialization system as an empty-serializable type. Because it implements IQueryTypeParameter and IEmptySerializable, it is intended for efficient ECS querying and correct handling by the game's custom serialization.
Fields
- This struct defines no instance fields.
The struct is intentionally empty (no managed fields) and relies on being a marker tag for entities.
Properties
- This struct defines no properties.
Use the presence/absence of the component on an entity to represent state.
Constructors
public DisasterFacilityData()
The default parameterless constructor is used. There are no fields to initialize.
Methods
- None declared on this type.
The implemented interfaces (IComponentData, IQueryTypeParameter, IEmptySerializable) are marker interfaces in this context and do not require methods to be defined here.
Usage Example
// Add the marker component to an entity (EntityManager API)
var disasterFacility = entityManager.CreateEntity();
entityManager.AddComponentData(disasterFacility, new DisasterFacilityData());
// Query all disaster facility entities
var query = entityManager.CreateQuery(typeof(DisasterFacilityData));
using var entities = query.ToEntityArray(Allocator.Temp);
// iterate entities as needed...
// In a system using Entities.ForEach (syntax depends on ECS version):
Entities.ForEach((Entity e, in DisasterFacilityData tag) =>
{
// handle disaster facility entity
});