Class RandomBot

Namespace
SurvivorsMaker.Balance
Assembly
SurvivorsMaker.Balance.dll

Seeded bot that periodically changes direction and randomly selects valid upgrades and purchases.

public class RandomBot : IRunBot
Inheritance
RandomBot
Implements
Derived
Inherited Members

Constructors

RandomBot(RandomBotSettings)

public RandomBot(RandomBotSettings settings = null)

Parameters

settings RandomBotSettings

Fields

Direction

protected Vec2 Direction

Field Value

Vec2

Random

protected SimRandom Random

Field Value

SimRandom

Settings

public readonly RandomBotSettings Settings

Field Value

RandomBotSettings

ShopRules

public IShopRules ShopRules

Field Value

IShopRules

Properties

Name

Short name shown in reports, e.g. "random" or "greedy".

public virtual string Name { get; }

Property Value

string

Methods

Accepts(RunState, LevelUpChoice)

protected bool Accepts(RunState run, LevelUpChoice choice)

Parameters

run RunState
choice LevelUpChoice

Returns

bool

Begin(RunState, SimRandom)

public virtual void Begin(RunState run, SimRandom random)

Parameters

run RunState
random SimRandom

ChooseLevelUp(RunState)

Index into Choices. Must be a choice the controller accepts.

public virtual int ChooseLevelUp(RunState run)

Parameters

run RunState

Returns

int

Merge(RunController)

protected void Merge(RunController controller)

Parameters

controller RunController

Move(SimWorld)

Movement for the next tick, length 0–1.

public virtual Vec2 Move(SimWorld world)

Parameters

world SimWorld

Returns

Vec2

Reflect(SimWorld, Vec2, float)

protected static Vec2 Reflect(SimWorld world, Vec2 direction, float margin)

Parameters

world SimWorld
direction Vec2
margin float

Returns

Vec2

Shop(RunController)

Spend the shop phase through the controller (buy, reroll, lock, merge, recycle). Do not call NextWave.

public virtual void Shop(RunController controller)

Parameters

controller RunController