Game.Prefabs.FirewatchTowerData
Assembly:
Game (Assembly-CSharp for typical Unity projects)
Namespace:
Game.Prefabs
Type:
struct
Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable
Summary:
FirewatchTowerData is an empty/marker ECS component used to tag entities that represent a firewatch tower prefab. The type is marked with [StructLayout(LayoutKind.Sequential, Size = 1)] so that the otherwise empty struct has a concrete size (1 byte) for serialization and native interop. The implemented interfaces indicate it is a component data type usable in queries (IQueryTypeParameter) and compatible with the Colossal serialization system (IEmptySerializable).
Fields
- none
This struct declares no fields. The StructLayout attribute (Size = 1) ensures the struct occupies a byte so it can be serialized and used as a distinct component even though it carries no payload.
Properties
- none
Constructors
public FirewatchTowerData()
The default parameterless constructor is the implicit compiler-generated constructor. The component is intended as a tag/marker and carries no data, so construction is trivial (default value).
Methods
- none
Usage Example
// Add the marker component to an existing entity
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.AddComponentData(someEntity, new FirewatchTowerData());
// Check for presence in a system (example)
if (entityManager.HasComponent<FirewatchTowerData>(someEntity))
{
// entity is a firewatch tower
}
Notes: - Use this component to mark entities so systems can query/filter for firewatch towers without storing additional data. - The IEmptySerializable and explicit size make this type compatible with the game's custom serialization pipeline.