Skip to content

Game.Buildings.ExtractorProperty

Assembly:
Assembly-CSharp (typical for game code; replace with actual assembly if different)

Namespace:
Game.Buildings

Type:
struct

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

Summary:
ExtractorProperty is an empty marker component used to tag entities that represent extractor-related buildings (for example quarries, oil rigs, resource extractors) within the ECS world. It carries no data; its presence on an entity is used for queries, filtering, and behavior selection. The struct is explicitly laid out with a size of 1 byte to support empty serialization and deterministic layout in the game's serialization pipeline.


Fields

  • This struct defines no instance fields. It is an intentionally empty marker component.

Additional info: - The type is annotated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a minimal size for serialization and compatibility with Colossal's serialization infrastructure (IEmptySerializable).

Properties

  • None. This component is data-less and does not expose properties.

Constructors

  • public ExtractorProperty() This is the implicit parameterless constructor for the struct. No initialization is required because the component contains no fields.

Methods

  • None declared. Behavior is driven by presence/absence of the component in entity queries and systems.

Usage Example

// Add the marker to an entity using EntityManager
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity extractorEntity = entityManager.CreateEntity();
entityManager.AddComponentData(extractorEntity, new Game.Buildings.ExtractorProperty());

// Query systems can filter by the marker:
public partial class ExtractorSystem : SystemBase
{
    protected override void OnUpdate()
    {
        Entities
            .WithAll<Game.Buildings.ExtractorProperty>()
            .ForEach((Entity entity /*, other component refs */) =>
            {
                // Handle extractor-specific logic here
            })
            .Schedule();
    }
}

// Check for presence:
if (entityManager.HasComponent<Game.Buildings.ExtractorProperty>(someEntity))
{
    // This entity is an extractor
}

Additional notes: - Use this marker when you need to group or identify extractor-type buildings in systems without adding per-instance data. - Because it implements IEmptySerializable, it participates in the game's serialization scheme for empty components; keep its empty nature if serialization expectations rely on it.