Game.Companies.ExtractorCompany
Assembly:
Assembly-CSharp.dll
Namespace:
Game.Companies
Type:
struct
Base:
IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
ExtractorCompany is an empty/tag ECS component used to mark entities that represent extractor companies in the game (e.g., resource extractor business entities). It contains no instance data; the struct exists purely as a marker for queries, archetypes and serialization integration. The StructLayout attribute with Size = 1 ensures the component has a non-zero native size for low-level/native serialization and memory layout expectations.
Fields
- This struct declares no managed instance fields.
The type is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to force a 1-byte native size despite being empty in C#, which is useful for native serialization and deterministic memory layout when working with Unity's DOTS/Colossal serialization systems.
Properties
- This type exposes no properties.
It implements marker/behavioral interfaces rather than storing data.
Constructors
- The type uses the implicit parameterless value-type constructor.
Since it is an empty struct, no explicit constructors are declared; default(T) yields an instance suitable for adding as a tag component.
Methods
- No instance or static methods are declared on this struct.
Behavior is provided by systems that query for the presence of the ExtractorCompany component on entities.
Usage Example
// Add the component to an entity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity extractorEntity = entityManager.CreateEntity();
entityManager.AddComponentData(extractorEntity, new ExtractorCompany());
// Querying in a SystemBase to operate on extractor companies
public partial class ExtractorSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAll<ExtractorCompany>()
.ForEach((Entity entity) =>
{
// Do work for extractor company entities
}).Schedule();
}
}
// Alternatively, use it as an archetype marker
EntityArchetype archetype = entityManager.CreateArchetype(typeof(ExtractorCompany), /* other components */);
Entity e = entityManager.CreateEntity(archetype);
Notes: - Implements IQueryTypeParameter to be usable directly in Entities.WithAll/WithAny/WithNone helper overloads. - Implements IEmptySerializable (from Colossal.Serialization.Entities) to participate correctly in the game's custom serialization pipeline for empty/tag components.