Game.Prefabs.TrafficAccidentType
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: enum
Base: System.Enum (underlying type: System.Int32)
Summary:
Represents the type/category of a traffic accident used by the game's traffic/prefab systems. Currently this enum defines a single accident type indicating that a vehicle lost control. This value is intended to be used by traffic simulation, incident generation, and any systems that need to classify accident causes for visuals, sound, or gameplay logic.
Fields
LoseControl
Indicates an accident caused by a vehicle losing control (e.g., skidding, spinning out, running off the road). This is currently the only defined accident type; additional types may be added in future updates to represent collisions, rollovers, or other incident causes.
Properties
- None.
This enum provides named constants only and has no properties.
Constructors
- Enum default constructor (implicit)
As with all enums, instances are represented by the underlying integral value (int). There are no public constructors to instantiate an enum besides assigning one of its named values.
Methods
- None specific to this enum.
Standard System.Enum methods (e.g., ToString(), HasFlag(), GetValues()) are available.
Usage Example
using Game.Prefabs;
public void HandleAccident(TrafficAccidentType type)
{
if (type == TrafficAccidentType.LoseControl)
{
// Spawn particle effects, play sound, inform traffic manager, etc.
SpawnSkidMarks();
PlayTireScreechSound();
}
}
Additional notes: - When reading or writing this value in serialized data/network messages, treat it as an integer (int) unless the surrounding API handles enum serialization automatically. - Because the enum currently has a single member, code should be written defensively (e.g., include a default/fallback case) in case new accident types are introduced in future game updates or mods.