Skip to content

Game.Objects.ObjectState

Assembly: Assembly-CSharp.dll
Namespace: Game.Objects

Type: enum

Base: System.Enum

Summary:
ObjectState is an enumeration used by game objects to represent a variety of discrete states an object can be in. Values cover life stages (Child → Elderly), removal/death states (Dead, Stump), occupancy/usage states (Empty, Full, Partial1/2), traffic orientation (LefthandTraffic, RighthandTraffic), temperature (Cold, Warm), positional/directional states (Forward, Backward), and a few render/logic hints (Outline, Track). This enum is not a bitmask — values are mutually exclusive. Modders should treat these as semantic states and avoid relying on specific underlying integer values, as they may change between versions.


Fields

  • None
    Default/unspecified state. Typically used when no particular state applies or the state is uninitialized.

  • Child
    Indicates the object represents a child life stage (citizen, animal, etc.) or the equivalent small-size growth stage.

  • Teen
    Indicates the object represents a teen life stage.

  • Adult
    Indicates the object represents an adult life stage.

  • Elderly
    Indicates the object represents an elderly life stage.

  • Dead
    Object is dead or marked for removal in a living-cycle context (citizens, animals, etc.).

  • Stump
    A leftover stump state (commonly used by tree objects after being cut down).

  • Empty
    Indicates emptiness (e.g., an empty container/slot, no occupants).

  • Full
    Indicates fullness (e.g., a container/slot that is filled or at capacity).

  • Clear
    A cleared state, often meaning no obstruction or cleaned/removed content.

  • Track
    Used where an object is part of or aligned to a "track" (rail, path) or marking usage as a track-type object.

  • Partial1
    One of two partial states; used to represent intermediate fill/placement/coverage states. Semantic meaning depends on the system using it.

  • Partial2
    Second partial/intermediate state, complementary to Partial1.

  • LefthandTraffic
    Specifies left-hand traffic orientation for this object (e.g., driving side orientation).

  • RighthandTraffic
    Specifies right-hand traffic orientation for this object.

  • Cold
    Indicates cold temperature/state (visual/logic cue for systems sensitive to temperature).

  • Warm
    Indicates warm temperature/state.

  • Home
    Indicates the object/entity is at home or in a "home" state (residence/assigned).

  • Homeless
    Indicates the object/entity has no home/assignment.

  • Motorcycle
    Denotes a motorcycle vehicle type or a motorcycle-specific state.

  • Forward
    Direction/state representing forward-facing or forward movement.

  • Backward
    Direction/state representing backward-facing or reverse movement.

  • Outline
    Rendering state indicating the object should be drawn in outline mode (selection/preview/overlay).

Properties

  • None
    This enum defines values only; there are no associated properties.

Constructors

  • implicit default constructor
    Enums do not define explicit instance constructors. The default value is the zero-valued enum member (usually the first declared member, here None), and instances are created/assigned by value.

Methods

  • None (defined here)
    ObjectState does not declare methods. Use standard System.Enum helpers where needed (e.g., ToString(), Enum.TryParse(), Enum.GetValues()).

Usage Example

// Example: checking and reacting to an object's state
void UpdateObjectState(GameObjectInstance obj)
{
    switch (obj.State) // obj.State is of type Game.Objects.ObjectState
    {
        case ObjectState.Child:
        case ObjectState.Teen:
        case ObjectState.Adult:
        case ObjectState.Elderly:
            // handle lifecycle/ageed visual or logic
            HandleCitizenLifecycle(obj);
            break;

        case ObjectState.Dead:
        case ObjectState.Stump:
            // cleanup or different rendering for dead/stump objects
            HandleRemoval(obj);
            break;

        case ObjectState.Empty:
            // do something for empty containers
            break;

        case ObjectState.Full:
            // do something when full
            break;

        case ObjectState.LefthandTraffic:
            SetTrafficSide(obj, leftHanded: true);
            break;

        case ObjectState.RighthandTraffic:
            SetTrafficSide(obj, leftHanded: false);
            break;

        case ObjectState.Outline:
            EnableOutlineRendering(obj, true);
            break;

        default:
            // fallback handling
            break;
    }
}

Notes for modders: - Do not assume numeric values; compare by name (enum member) for forward compatibility. - Because this enum groups many unrelated categories (growth, traffic, temperature, rendering), confirm which subsystem sets/reads the value before modifying it. Conflicts can arise if multiple systems reuse the same enum field for different semantics.