Skip to content

Game.Prefabs.TerraformingTarget

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: enum

Base: System.Int32

Summary:
Represents the target type for terraforming operations in the game (e.g., what resource or property the terraforming tool should affect). Commonly used by terrain/terraforming systems and mod code to select or test which aspect of the world to modify.


Fields

  • None = -1
    Represents no target / invalid selection. Useful as a default or to indicate that no terraforming target is currently selected.

  • Height
    Targets terrain height (elevation) modifications.

  • Ore
    Targets ore deposits (mineral resources).

  • Oil
    Targets oil deposits.

  • FertileLand
    Targets fertile land (affects agricultural suitability).

  • GroundWater
    Targets groundwater / water table related modifications.

  • Material
    Targets generic material-related terrain (e.g., surface material or construction material layers).

Notes: - The explicit numeric values: None = -1, Height = 0, Ore = 1, Oil = 2, FertileLand = 3, GroundWater = 4, Material = 5. - Use these members to branch logic in tools or systems that react differently depending on which terraforming target is active.

Properties

  • This enum type does not define properties. Enums expose no instance properties beyond the standard System.Enum functionality.

Constructors

  • Enums do not have user-defined constructors. The underlying values are the defined integral constants. You can initialize variables of this enum type by assignment, e.g., TerraformingTarget target = TerraformingTarget.Height;.

Methods

  • No instance methods are defined on the enum. You can use standard Enum helpers from System.Enum (e.g., Enum.GetName, Enum.IsDefined) and cast to/from the underlying integer type as needed.

Usage Example

using Game.Prefabs;

public void ApplyTerraforming(TerraformingTarget target)
{
    switch (target)
    {
        case TerraformingTarget.Height:
            // modify terrain elevation
            break;
        case TerraformingTarget.Ore:
            // place or remove ore deposits
            break;
        case TerraformingTarget.Oil:
            // handle oil deposits
            break;
        case TerraformingTarget.FertileLand:
            // adjust fertility values
            break;
        case TerraformingTarget.GroundWater:
            // change groundwater/water table
            break;
        case TerraformingTarget.Material:
            // change surface material
            break;
        case TerraformingTarget.None:
        default:
            // no-op or reset selection
            break;
    }
}

// Casting to/from int:
int intValue = (int)TerraformingTarget.Ore; // 1
TerraformingTarget fromInt = (TerraformingTarget)intValue;

Additional notes for modders: - Use TerraformingTarget to store user/tool selection state or to serialize which type of terraforming was applied. - When reading values from external sources (save files, network, UI), validate with Enum.IsDefined or handle out-of-range values (e.g., treat unknown values as TerraformingTarget.None).