Skip to content

Game.AdminBuilding

Assembly: Assembly-CSharp
Namespace: Game.Buildings

Type: struct

Base: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary: AdminBuilding is an empty/tag ECS component used to mark entities that represent administrative buildings in the game's entity/component system. The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a non-zero, predictable memory layout (useful for serialization/interop), and it implements IEmptySerializable to indicate it has no instance fields to serialize while still participating in Colossal's serialization pipeline. As an IComponentData it can be attached to entities and used in queries or systems to identify administrative buildings.


Fields

  • None
    This struct contains no instance fields. It is intentionally empty and functions as a tag/marker component.

Properties

  • None
    No properties are defined.

Constructors

  • public AdminBuilding()
    No explicit constructors are defined in the source; the type relies on the default value-type constructor (i.e., default(AdminBuilding)). The StructLayout attribute gives the type a size of 1 byte at runtime.

Methods

  • None
    No methods are declared. The type only serves as a marker component via implemented interfaces.

Usage Example

// Add the tag component to an entity
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
var archetype = em.CreateArchetype(typeof(AdminBuilding), typeof(SomeOtherComponent));
var adminEntity = em.CreateEntity(archetype);

// Or add to an existing entity
em.AddComponentData(adminEntity, new AdminBuilding());

// Querying for admin buildings in a system
Entities.WithAll<AdminBuilding>().ForEach((Entity e) =>
{
    // handle admin building entity
}).Schedule();