Skip to content

Game.Prefabs.TerraformingData

Assembly:
Assembly-CSharp (typical Unity game assembly; exact assembly may vary)

Namespace:
Game.Prefabs

Type:
struct

Base:
IComponentData, IQueryTypeParameter

Summary:
A small ECS component used to describe a terraforming operation in the game. This struct is intended to be attached to entities that represent pending or applied terraforming actions. It stores the kind of terraforming operation and its target. Being an IComponentData, it is a plain, blittable data container suitable for use in Unity.Entities systems. Implementing IQueryTypeParameter makes it usable directly in Entities query type parameters where required.


Fields

  • public TerraformingType m_Type
    Describes the operation type (for example: raise, lower, flatten, smoothing). The enum TerraformingType is defined elsewhere in the codebase and determines how the terrain should be modified.

  • public TerraformingTarget m_Target
    Specifies what the operation targets (for example: land, water, terrain layer). TerraformingTarget is an enum defined elsewhere; it identifies the destination or scope of the terraforming action.

Properties

  • None
    This struct exposes only public fields and does not provide properties.

Constructors

  • public TerraformingData()
    Implicit default constructor provided by C#. Use object initializer syntax to create and populate instances. There are no specialized constructors defined in the source.

Methods

  • None
    No methods are defined on this struct. It is a plain data container intended for storage and querying via the ECS.

Usage Example

// Example: create an entity with a TerraformingData component and set fields
var entity = entityManager.CreateEntity(typeof(TerraformingData));

var terraform = new TerraformingData
{
    m_Type = TerraformingType.Raise,       // example enum value
    m_Target = TerraformingTarget.Land     // example enum value
};

entityManager.SetComponentData(entity, terraform);

// Alternatively, add and set in one call (depending on API version)
entityManager.AddComponentData(entity, terraform);

Notes: - Replace TerraformingType and TerraformingTarget enum values with the actual values defined in your mod/game code. - As an ECS component, TerraformingData should be used from Jobs or Systems that operate on IComponentData; ensure thread-safety and data access rules for Unity.Entities are followed.