Class LevelDef

Namespace
TDMaker.Core.Defs
Assembly
TDMaker.Core.dll

Immutable simulation inputs baked by an authoring layer.

public sealed class LevelDef
Inheritance
LevelDef
Inherited Members

Constructors

LevelDef(PathDef[], BuildSlotDef[], WaveDef[], int, int, string[], float?, string[], string[])

Creates a level and copies all top-level collections.

public LevelDef(PathDef[] paths, BuildSlotDef[] buildSlots, WaveDef[] waves, int startingGold, int startingLives, string[] availableTowers = null, float? rangeYScale = null, string[] availableSpells = null, string[] availableHeroes = null)

Parameters

paths PathDef[]
buildSlots BuildSlotDef[]
waves WaveDef[]
startingGold int
startingLives int
availableTowers string[]
rangeYScale float?
availableSpells string[]
availableHeroes string[]

Properties

AvailableHeroes

Available independent hero template identifiers.

public IReadOnlyList<string> AvailableHeroes { get; }

Property Value

IReadOnlyList<string>

AvailableSpells

Available spell identifiers, ordered to match Simulation.Spells.

public IReadOnlyList<string> AvailableSpells { get; }

Property Value

IReadOnlyList<string>

AvailableTowers

Buildable base tower identifiers; upgrades are checked against their source tower.

public IReadOnlyList<string> AvailableTowers { get; }

Property Value

IReadOnlyList<string>

BuildSlots

Construction locations.

public IReadOnlyList<BuildSlotDef> BuildSlots { get; }

Property Value

IReadOnlyList<BuildSlotDef>

Paths

Paths used by enemy waves.

public IReadOnlyList<PathDef> Paths { get; }

Property Value

IReadOnlyList<PathDef>

RangeYScale

Optional vertical ellipse radius ratio overriding the simulation configuration.

public float? RangeYScale { get; }

Property Value

float?

Rules

Authoritative economy and M2 rules; overrides the legacy per-tower refund field.

public LevelRulesDef Rules { get; }

Property Value

LevelRulesDef

StartingGold

Starting gold.

public int StartingGold { get; }

Property Value

int

StartingLives

Starting lives.

public int StartingLives { get; }

Property Value

int

Upgrades

Optional immutable permanent-upgrade input, applied before entity pools and initial spawns.

public UpgradeSnapshot Upgrades { get; }

Property Value

UpgradeSnapshot

Waves

Ordered waves.

public IReadOnlyList<WaveDef> Waves { get; }

Property Value

IReadOnlyList<WaveDef>

Methods

WithRules(LevelRulesDef)

Copies the level with immutable M2 and economy rules.

public LevelDef WithRules(LevelRulesDef rules)

Parameters

rules LevelRulesDef

Returns

LevelDef

WithUpgrades(UpgradeSnapshot)

Copies the level with a battle snapshot; null preserves the unmodified-template setup.

public LevelDef WithUpgrades(UpgradeSnapshot upgrades)

Parameters

upgrades UpgradeSnapshot

Returns

LevelDef