Skip to content

Game.ApplyMode

Assembly: Assembly-CSharp
Namespace: Game.Tools

Type: enum

Base: System.Enum

Summary:
Represents the action mode used by tools to determine whether they should apply changes, clear/remove them, or perform no action. Commonly used in tool logic to switch behavior between doing nothing, applying a modification, or clearing an existing modification (for example painting vs. erasing terrain, props, or other map edits).


Fields

  • None
    Represents the default/no-action mode. Tools should take no modifying action when this mode is set.

  • Apply
    Indicates the tool should perform its primary apply operation (e.g., place or modify an object, paint an area).

  • Clear
    Indicates the tool should clear, remove, or undo the applied element(s) (e.g., erase objects, remove painted data).

Properties

  • (None)
    Enums do not expose custom instance properties. Use the enum values directly in logic. Standard System.Enum behavior (ToString, HasFlag for flags enums, etc.) applies.

Constructors

  • (Default enum construction)
    Enums are value types and do not have user-defined constructors. You can assign values directly, e.g. ApplyMode mode = ApplyMode.None;.

Methods

  • (No custom methods)
    There are no instance methods defined on this enum. You can use the standard System.Enum and value-type operations:
  • ToString() — get the name of the enum value.
  • Enum.Parse / Enum.TryParse — parse from string.
  • Comparisons — compare enum values directly (==, !=).
  • If this were a flags enum, you could use HasFlag, but ApplyMode is a simple discrete-mode enum.

Usage Example

// Example usage inside a tool update loop
public class ExampleTool
{
    private ApplyMode currentMode = ApplyMode.None;

    public void SetMode(ApplyMode mode)
    {
        currentMode = mode;
    }

    public void OnToolAction(Vector3 position)
    {
        switch (currentMode)
        {
            case ApplyMode.None:
                // do nothing
                break;
            case ApplyMode.Apply:
                ApplyAt(position);
                break;
            case ApplyMode.Clear:
                ClearAt(position);
                break;
        }
    }

    private void ApplyAt(Vector3 pos)
    {
        // Implementation to place or modify content
    }

    private void ClearAt(Vector3 pos)
    {
        // Implementation to remove or clear content
    }
}