Skip to content

Game.Companies.IndustrialCompany

Assembly:
Assembly-CSharp.dll

Namespace: Game.Companies

Type: struct

Base: System.ValueType
Implements: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary: IndustrialCompany is an empty/tag component used by the game's ECS to mark an entity as representing an industrial company. The struct is attributed with [StructLayout(LayoutKind.Sequential, Size = 1)] to guarantee a non‑zero size for native/serialization usage. As an empty component it carries no data and acts purely as a marker for queries, systems, and serialization behavior.


Fields

  • (none)
    This type intentionally contains no fields. It is a marker (tag) component; presence/absence on an entity is the only information it conveys.

Properties

  • (none)
    There are no properties. Use the presence of the component on an entity to represent the industrial company state.

Constructors

  • public IndustrialCompany()
    Structs have an implicit parameterless constructor; no explicit constructor is defined in source.

Methods

  • (none)
    No methods are defined. Interfaces implemented are marker/typing interfaces and do not require instance methods here.

Usage Example

// Add the marker to an entity with an EntityManager
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var entity = entityManager.CreateEntity();
entityManager.AddComponentData(entity, new Game.Companies.IndustrialCompany());

// Check for the marker
bool isIndustrial = entityManager.HasComponent<Game.Companies.IndustrialCompany>(entity);

// Remove the marker
entityManager.RemoveComponent<Game.Companies.IndustrialCompany>(entity);

Additional notes: - IComponentData: marks this as an ECS component usable with Unity's Entities API. - IQueryTypeParameter: allows the type to be used as a type parameter in query definitions. - IEmptySerializable: used by Colossal's serialization to treat the component as serializable even though it's empty. - The StructLayout attribute with Size = 1 ensures the struct has a physical size for native layout/serialization compatibility.