Skip to content

Game.Companies.ResourceSeller

Assembly:
Namespace: Game.Companies

Type: struct

Base: System.ValueType, IComponentData, IQueryTypeParameter, IEmptySerializable

Summary: ResourceSeller is an empty/tag ECS component used to mark entities that represent a company or entity which sells resources. It is defined as a sequential-layout struct with Size = 1 so it can be serialized and recognized by the Colossal serialization pipeline and Unity's ECS. Because it implements IComponentData it can be attached to entities and used in queries (e.g., to filter systems to entities that sell resources). The IEmptySerializable and IQueryTypeParameter interfaces indicate that this type is intended for use as an empty/marker component and participates correctly in the game's custom serialization and query systems.


Fields

This struct defines no instance fields. The StructLayout(Size = 1) attribute ensures the type has a defined size for serialization even though it contains no data.

Properties

This component exposes no properties. It is intended as a zero-data/tag component.

Constructors

  • public ResourceSeller() This is the implicit default constructor for the struct. No custom construction logic is required or provided.

Methods

This type does not declare methods. It implements marker interfaces: - IComponentData — makes it a Unity ECS component - IQueryTypeParameter — allows use in query type specifications - IEmptySerializable — indicates it is an empty component that participates in the Colossal serialization system

Usage Example

// Add the tag component to an entity so it can be found by systems that handle resource selling
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.AddComponentData(someEntity, new Game.Companies.ResourceSeller());

// Query for entities that sell resources in a system (example using SystemAPI):
public partial struct ResourceSellingSystem : ISystem
{
    public void OnUpdate(ref SystemState state)
    {
        foreach (var entity in SystemAPI.Query<Entity>().WithAll<Game.Companies.ResourceSeller>())
        {
            // handle resource-selling logic for 'entity'
        }
    }
}