Skip to content

Game.Companies.CommercialCompany

Assembly: Assembly-CSharp
Namespace: Game.Companies

Type: struct

Base: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary: CommercialCompany is an empty (marker/tag) ECS component used to mark entities that represent commercial companies in the game's entity-component-system. The struct is deliberately empty but given a non-zero size via StructLayout(LayoutKind.Sequential, Size = 1) so it can be stored, queried and serialized safely by Unity's DOTS systems and the Colossal serialization layer.


Fields

  • This struct declares no instance fields. It is used purely as a tag/marker component to identify commercial-company entities in ECS queries and systems.

Properties

  • This type exposes no properties. Its behavior is defined by the fact that it implements IComponentData/IQueryTypeParameter and is therefore usable as a component in ECS queries and filters.

Constructors

  • public CommercialCompany() This type uses the default parameterless struct constructor provided by the runtime. The explicit StructLayout(Size = 1) attribute ensures the instance occupies a non-zero amount of memory, which is important for serialization and native interop.

Methods

  • This type declares no methods. It is intended only as an empty marker component.

Usage Example

// Add the tag to an entity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity companyEntity = entityManager.CreateEntity();
entityManager.AddComponentData(companyEntity, new Game.Companies.CommercialCompany());

// Query for all entities tagged as commercial companies
Entities
    .WithAll<Game.Companies.CommercialCompany>()
    .ForEach((Entity e) =>
    {
        // process commercial company entity e
    }).Schedule();

Additional notes: - The IEmptySerializable marker indicates compatibility with Colossal.Serialization.Entities for serialization of empty components. - Use this component in systems as a filter (WithAll/WithNone) or as a tag when creating entities that should be treated as commercial companies by game logic.