Game.DecalLayers
Assembly:
Namespace: Game.Rendering
Type: public enum
Base: System.Enum
Summary:
Flags enum that defines decal rendering layers used by the game's rendering system. Each value represents a layer to which decals (textures/markings applied at render time) can be applied. Values are powers of two so multiple layers can be combined with bitwise operations to target more than one layer at once. This is typically used by rendering or decal-management code to include/exclude decals for specific categories (terrain, roads, buildings, etc.).
Fields
-
Terrain = 1
Decals applied to terrain surfaces (ground, terrain detail textures). -
Roads = 2
Decals for road surfaces (lane markings, wear, road-specific overlays). -
Buildings = 4
Decals applied to building exteriors. -
Vehicles = 8
Decals attached to vehicles (paint, stickers, vehicle-specific markings). -
Creatures = 0x10
Decals for creatures/animals in the world. -
Other = 0x20
Miscellaneous decals not covered by the other defined layers.
Properties
- This enum type does not declare any properties. Use bitwise operations or System.Enum helper methods at call sites.
Constructors
- Enums do not expose public constructors. Instances are created by assigning enum values (e.g., DecalLayers.Terrain).
Methods
- The enum itself does not declare methods. Use standard enum/bitwise patterns and .NET helpers such as:
- Enum.HasFlag(DecalLayers)
- Bitwise operations (&, |, ~) to test, combine, add, or remove flags.
Usage Example
// Combine layers
DecalLayers layers = DecalLayers.Terrain | DecalLayers.Roads;
// Check for a layer (bitwise)
bool includesRoads = (layers & DecalLayers.Roads) != 0;
// Or using HasFlag (slightly slower, but readable)
bool includesTerrain = layers.HasFlag(DecalLayers.Terrain);
// Add a layer
layers |= DecalLayers.Buildings;
// Remove a layer
layers &= ~DecalLayers.Roads;