Skip to content

Game.Prefabs.IndustrialProcess

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType

Summary:
Serializable plain-data struct that describes a single industrial production process used by prefab definitions in the game's editor/runtime. An IndustrialProcess specifies up to two input stacks, one output stack, and a float that expresses how many workers are required (per production cell) to run this process. This struct is intended to be embedded in building/prefab definitions to describe resource conversions performed by industrial zones or buildings.


Fields

  • public ResourceStackInEditor m_Input1
    Represents the primary input resource stack for the process. Typically contains a resource type and an amount (see ResourceStackInEditor for details). May be empty/null depending on how ResourceStackInEditor is defined; used as the first ingredient.

  • public ResourceStackInEditor m_Input2
    Represents an optional secondary input resource stack for the process. When a process needs two inputs (e.g., combining resources), this field is used.

  • public ResourceStackInEditor m_Output
    Represents the output resource stack produced by the process. Describes what resource and how much is produced when the process runs.

  • public float m_MaxWorkersPerCell
    Float value expressing the maximum number of workers required per “cell” (unit of production) for this process. This value is used to model workforce requirements and to scale production rates based on available workers.

Properties

This type defines no properties; it exposes public fields only.

Constructors

  • public IndustrialProcess()
    The implicit parameterless constructor produced by the C# compiler initializes value-type fields to their default values (for ResourceStackInEditor: default/empty; for float: 0f). When creating an instance explicitly, you will commonly assign each field afterwards.

Methods

This struct does not declare any methods.

Usage Example

// Example: creating and assigning an IndustrialProcess for a prefab.
// Adjust ResourceStackInEditor initialization according to its actual API.

var inputA = new ResourceStackInEditor(); // fill in type/amount as required
var inputB = new ResourceStackInEditor(); // optional
var output = new ResourceStackInEditor(); // fill in type/amount

var process = new Game.Prefabs.IndustrialProcess
{
    m_Input1 = inputA,
    m_Input2 = inputB, // set to default/empty if not used
    m_Output = output,
    m_MaxWorkersPerCell = 1.5f
};

// Attach to a prefab or editor data structure as appropriate:
// myPrefab.m_IndustrialProcesses = new[] { process };

Notes and modding tips: - Because IndustrialProcess is a struct, copies are value copies. Modify the instance stored in a prefab/array rather than a temporary copy. - The exact semantics of ResourceStackInEditor (fields, constructors, and how emptiness is represented) determine how to construct input/output stacks—consult that type's documentation. - m_MaxWorkersPerCell affects production scaling; choose values consistent with other process definitions in the prefab to maintain balanced behavior.