Game.Prefabs.ExtractorCompanyData
Assembly:
Assembly-CSharp (game runtime assembly; typical for Cities: Skylines 2 mods)
Namespace:
Game.Prefabs
Type:
struct
Base:
System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
ExtractorCompanyData is an empty/tag component used by the Unity DOTS/ECS layer to mark or identify entities that represent an "extractor company" prefab. The struct is explicitly given a sequential layout with Size = 1 to ensure it is not treated as a zero-sized type at runtime. As an IComponentData it can be attached to entities; as an IQueryTypeParameter it can be used in queries or query-related APIs. The type contains no fields or methods — its presence on an entity is its semantic meaning.
Fields
- This struct defines no instance fields. It is intentionally empty and acts as a marker/tag component.
Properties
- This struct defines no properties.
Constructors
- The struct has the implicit parameterless default constructor (value default). No custom constructors are defined.
Methods
- This struct declares no methods. It only serves as a type marker for ECS usage.
Usage Example
// Add the tag component to an existing entity
entityManager.AddComponentData(entity, new Game.Prefabs.ExtractorCompanyData());
// Or add the component type without providing a value (API-dependent)
entityManager.AddComponent<Game.Prefabs.ExtractorCompanyData>(entity);
// Use in a system query (example)
Entities
.WithAll<Game.Prefabs.ExtractorCompanyData>()
.ForEach((Entity e) =>
{
// handle extractor-company entities
}).Schedule();
Additional notes: - The StructLayout(Size = 1) attribute prevents the type from being optimized to a zero-sized component; this can be important for interop or certain ECS behaviors. - Because it's a marker component, data about extractor companies (capacity, owners, etc.) is expected to be stored in other components attached to the same entity.