Skip to content

Game.Tutorials.ForestFireActivationData

Assembly:
Assembly-CSharp (common for Unity game/mod code; the type is defined in the game's scripts)

Namespace:
Game.Tutorials

Type:
struct

Base:
System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Attributes: [StructLayout(LayoutKind.Sequential, Size = 1)]

Summary:
ForestFireActivationData is an empty "tag" or marker component used with Unity's DOTS/ECS in Cities: Skylines 2 mod code. It carries no payload data but serves as an identifiable component type that systems and queries can test for. The StructLayout attribute with Size = 1 ensures the type has a non-zero size (1 byte) and a defined memory layout so it behaves predictably when used by the Entity Component System.


Fields

  • This struct defines no instance fields.
    The type is intentionally empty (a marker/tag component). The explicit StructLayout(Size = 1) makes the type occupy 1 byte in memory even though it has no fields.

Properties

  • This type exposes no properties.
    It is intended purely as a marker component implementing IComponentData and IQueryTypeParameter.

Constructors

  • public ForestFireActivationData() (implicit default)
    As a value type, it has the implicit parameterless constructor generated by the runtime. No custom constructors are defined.

Methods

  • This type declares no methods.
    Its purpose is to be attached to entities or used in queries to indicate that the "forest fire" tutorial/activation state applies.

Usage Example

// Example 1: Create a singleton/tag entity that marks the forest fire tutorial as active
protected override void OnCreate()
{
    base.OnCreate();
    // Create an entity that only holds the marker component
    Entity tutorialMarker = EntityManager.CreateEntity(typeof(Game.Tutorials.ForestFireActivationData));
}

// Example 2: Add the tag to an existing entity
void ActivateForestFireTutorial(Entity someEntity)
{
    if (!EntityManager.HasComponent<Game.Tutorials.ForestFireActivationData>(someEntity))
    {
        EntityManager.AddComponent<Game.Tutorials.ForestFireActivationData>(someEntity);
    }
}

// Example 3: Query systems can filter by the tag
Entities
    .WithAll<Game.Tutorials.ForestFireActivationData>()
    .ForEach((Entity e, ref SomeOtherComponent sc) =>
    {
        // Run tutorial-related behavior for entities marked with the tag
    }).Schedule();