Class LevelDef
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
pathsPathDef[]buildSlotsBuildSlotDef[]wavesWaveDef[]startingGoldintstartingLivesintavailableTowersstring[]rangeYScalefloat?availableSpellsstring[]availableHeroesstring[]
Properties
AvailableHeroes
Available independent hero template identifiers.
public IReadOnlyList<string> AvailableHeroes { get; }
Property Value
AvailableSpells
Available spell identifiers, ordered to match Simulation.Spells.
public IReadOnlyList<string> AvailableSpells { get; }
Property Value
AvailableTowers
Buildable base tower identifiers; upgrades are checked against their source tower.
public IReadOnlyList<string> AvailableTowers { get; }
Property Value
BuildSlots
Construction locations.
public IReadOnlyList<BuildSlotDef> BuildSlots { get; }
Property Value
Paths
Paths used by enemy waves.
public IReadOnlyList<PathDef> Paths { get; }
Property Value
RangeYScale
Optional vertical ellipse radius ratio overriding the simulation configuration.
public float? RangeYScale { get; }
Property Value
Rules
Authoritative economy and M2 rules; overrides the legacy per-tower refund field.
public LevelRulesDef Rules { get; }
Property Value
StartingGold
Starting gold.
public int StartingGold { get; }
Property Value
StartingLives
Starting lives.
public int StartingLives { get; }
Property Value
Upgrades
Optional immutable permanent-upgrade input, applied before entity pools and initial spawns.
public UpgradeSnapshot Upgrades { get; }
Property Value
Waves
Ordered waves.
public IReadOnlyList<WaveDef> Waves { get; }
Property Value
Methods
WithRules(LevelRulesDef)
Copies the level with immutable M2 and economy rules.
public LevelDef WithRules(LevelRulesDef rules)
Parameters
rulesLevelRulesDef
Returns
WithUpgrades(UpgradeSnapshot)
Copies the level with a battle snapshot; null preserves the unmodified-template setup.
public LevelDef WithUpgrades(UpgradeSnapshot upgrades)
Parameters
upgradesUpgradeSnapshot