UnityTowerDefense/Assets/_Project/Scripts/Core/Enums.cs

88 lines
3.2 KiB
C#

namespace TD.Core
{
/// <summary>
/// Identifies a player slot in a match. Backed by byte to keep grid arrays compact.
/// </summary>
/// <remarks>
/// <c>None</c> is a sentinel value used in <c>OwnerGrid</c> to mark tiles not owned by any player zone.
/// Player1..Player9 cover the maximum supported player count. Maps using fewer players use a
/// contiguous prefix (e.g., a 3-player map uses Player1, Player2, Player3 only).
/// </remarks>
public enum PlayerSlot : byte
{
None = 0,
Player1 = 1,
Player2 = 2,
Player3 = 3,
Player4 = 4,
Player5 = 5,
Player6 = 6,
Player7 = 7,
Player8 = 8,
Player9 = 9,
}
/// <summary>
/// Whether a volume permits tower placement on the tiles it covers.
/// </summary>
/// <remarks>
/// Defaults: <c>Allowed</c> for <see cref="TD.Levels.PlayerZoneVolume"/>, <c>Invalid</c> for
/// <see cref="TD.Levels.SpawnerVolume"/>, <see cref="TD.Levels.LeakExitVolume"/>, and
/// <see cref="TD.Levels.GoalVolume"/>.
/// Composition rule when volumes overlap: "Invalid wins" — any tile covered by an Invalid volume
/// becomes <see cref="PlacementState.Restricted"/> regardless of other volumes covering it.
/// </remarks>
public enum PlacementValidity
{
Invalid = 0,
Allowed = 1,
}
/// <summary>
/// Cardinal direction for spawner facing. Used by gizmos (direction arrow) and may be used
/// at runtime to bias initial enemy movement direction out of a spawner.
/// </summary>
public enum Direction
{
North,
South,
East,
West,
}
/// <summary>
/// Per-tile placement state in the baked <c>PlacementGrid</c>.
/// </summary>
/// <remarks>
/// Backed by byte so default-initialized arrays (all zero) start as <c>Outside</c>, which is
/// the correct default for any tile not covered by an authoring volume.
/// </remarks>
public enum PlacementState : byte
{
/// <summary>Tile is not covered by any authoring volume. Towers cannot be placed.</summary>
Outside = 0,
/// <summary>Tile is inside a player zone and not covered by any Invalid-validity volume.
/// Towers can be placed here (subject to runtime checks: ownership, footprint, gold, path).</summary>
Buildable = 1,
/// <summary>Tile is covered by at least one Invalid-validity volume (spawner, leak exit, goal).
/// Towers cannot be placed here. Note: this affects placement only; pathfinding still treats
/// the tile as walkable.</summary>
Restricted = 2,
}
/// <summary>
/// Outcome of a bake operation, recorded on the baked <see cref="TD.Levels.LevelData"/> asset.
/// </summary>
/// <remarks>
/// Failure is not represented here because failed bakes do not persist any state to the asset —
/// the previous successful bake (if any) remains on disk untouched. Failure state lives in
/// editor-only memory and is not part of the data schema.
/// </remarks>
public enum BakeOutcome
{
Success,
SuccessWithWarnings,
}
}