BWAPI::CommandOptimizer class

Used for optimizing several commands of the same type, usually by grouping units together.

Constructors, destructors, conversion operators

CommandOptimizer(Game& game)

Public functions

auto add(UnitCommand command) -> bool
Adds a command to the optimizer and performs pre-processing.
void clear()
Clears and discards all queued commands.
void flush()
Flushes commands from the optimizer and executes them. Groups commands together before execution.
void init()
Initializes the optimizer. Used at the beginning and ending of games. Clears queued commands and resets optimizer settings.

Public variables

int level
The optimization level.

Function documentation

bool BWAPI::CommandOptimizer::add(UnitCommand command)

Adds a command to the optimizer and performs pre-processing.

Attempts to generalize commands of different types and reduce command byte size.