Game.Buildings.SpawnLocationType
Assembly:
Namespace: Game.Buildings
Type: enum
Base: System.Enum
Summary: Enum that identifies the type of location associated with a building node or slot for spawning, parking, or idling purposes. Used by building/traffic code to determine how agents (vehicles, pedestrians) should behave at a given location — whether it's a valid spawn point, a hangaround (wait/idle) spot, or a parking lane. This is a simple, non-flags enum; values map to integer identifiers used across building/AI logic and can be used by mods to alter spawn/parking behaviors.
Fields
-
None
Represents no special spawn/parking semantics. Use when a node/slot should not be treated as a spawn, hangaround, or parking location. -
SpawnLocation
Marks a valid spawn point where vehicles/pedestrians can be created or enter the simulation from the building. -
HangaroundLocation
Indicates a location where agents may wait, idle, or linger (e.g., waiting areas near building entrances). -
ParkingLane
Denotes a parking lane or parking slot used by vehicles to park or queue at the building.
Properties
- This enum defines named constants only and has no properties.
Constructors
- Enums do not have explicit constructors in C#; values are the named constants listed above.
Methods
- Enums do not define methods in this declaration. Standard System.Enum methods (ToString, Parse, GetValues, etc.) are available.
Usage Example
using Game.Buildings;
public void HandleBuildingSlot(int slotIndex, SpawnLocationType locType)
{
switch (locType)
{
case SpawnLocationType.SpawnLocation:
// Create or release a vehicle/pedestrian at this slot
SpawnAgentAtSlot(slotIndex);
break;
case SpawnLocationType.HangaroundLocation:
// Mark agent to wait/idle here
MakeAgentWait(slotIndex);
break;
case SpawnLocationType.ParkingLane:
// Treat this slot as parking: reserve space or find a path to park
ReserveParking(slotIndex);
break;
case SpawnLocationType.None:
default:
// Default behavior — no special spawn/parking logic
break;
}
}
// Example of storing/retrieving as an integer (serialization or native interop)
int savedValue = (int)SpawnLocationType.ParkingLane;
SpawnLocationType loaded = (SpawnLocationType)savedValue;
{{ Notes for modders: This enum is commonly checked in building AI and traffic/spawning systems. Because it's a plain enum, you can cast to/from int for storage or interop. It is not marked with [Flags], so do not combine values. When adding custom behavior, ensure compatibility with existing AI code paths that expect these values. }}