Class UnitSandbox

Namespace
TDMaker.Editor
Assembly
TDMaker.Editor.dll

The Unit Workshop's test range: a straight lane with the chosen towers beside it, and a wave of the unit under test (or, for heroes and soldiers, a wave of an opponent enemy against them). Run(Setup) plays it headless and deterministically (fixed seed, fixed tick); BuildLevel(Setup, List<Object>) returns the same level for the play-mode sandbox.

public static class UnitSandbox
Inheritance
UnitSandbox
Inherited Members

Methods

BuildLevel(Setup, List<Object>)

Builds the in-memory test level (assets marked DontSave; destroy them with Release(List<Object>)). Slot i holds tower i; a soldier under test gets a barracks of three in the middle; a hero under test stands at the lane centre.

public static LevelAsset BuildLevel(UnitSandbox.Setup setup, List<Object> owned)

Parameters

setup UnitSandbox.Setup
owned List<Object>

Returns

LevelAsset

BuyAllAbilities(Simulation)

Buys every rank of every ability of the built towers (one rank per tick, so each purchase sees the previous one).

public static void BuyAllAbilities(Simulation sim)

Parameters

sim Simulation

Release(List<Object>)

Destroys the assets created by BuildLevel(Setup, List<Object>).

public static void Release(List<Object> owned)

Parameters

owned List<Object>

Run(Setup)

Plays the sandbox headless: builds every tower, calls the wave and runs to the end or the time limit.

public static UnitSandbox.Result Run(UnitSandbox.Setup setup)

Parameters

setup UnitSandbox.Setup

Returns

UnitSandbox.Result