Skip to content

Game.Buildings.OfficeProperty

Assembly: Assembly-CSharp (Game runtime)
Namespace: Game.Buildings

Type: struct

Base: System.ValueType; implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable

Summary: OfficeProperty is an empty/tag component used by the game's ECS to mark an entity as representing an "office property". The struct is intentionally empty but decorated with StructLayout(LayoutKind.Sequential, Size = 1) so it has a non-zero size for serialization/interop purposes and to satisfy marshalling/serialization systems. Because it implements IComponentData it can be attached to entities; IQueryTypeParameter lets it be used in queries, and IEmptySerializable signals to the Colossal serialization system that this type has special empty-struct serialization semantics.


Fields

  • None
    OfficeProperty declares no member fields. The StructLayout(Size = 1) attribute ensures the type occupies one byte despite being otherwise empty, which helps with serialization and native interop expectations.

Properties

  • None

Constructors

  • public OfficeProperty()
    This type uses the default parameterless constructor provided by the runtime. The struct is effectively a marker and requires no initialization data.

Methods

  • None
    There are no methods declared on this struct. Behavior is provided by systems that query for or check the presence of this component on entities.

Usage Example

using Unity.Entities;
using Game.Buildings;

// Create an entity with the marker component
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var archetype = entityManager.CreateArchetype(typeof(OfficeProperty));
var officeEntity = entityManager.CreateEntity(archetype);

// Or add the marker to an existing entity
entityManager.AddComponentData(existingEntity, new OfficeProperty());

Notes: - Use this component as a tag in entity queries to select office-related entities, e.g. EntityQueryBuilder or EntityManager.CreateEntityQuery(typeof(OfficeProperty)). - The IEmptySerializable interface and the explicit struct layout indicate the type participates in the game's custom serialization pipeline for empty marker components.