#include <robbase.h>
Public Methods | |
| Simulation (const Globals &glob, const ErrorHandler *) | |
| ~Simulation () | |
| Program * | run () |
| returns the winner, or 0 if a tie occured. | |
| rint | getAllNumBots () |
| returns sum of the bot counts for all programs. | |
| void | addProgram (Program *program) |
| adds a program to the current sim; only before starting it. | |
| int | getNumPrograms () |
| Returns number of programs in this simulation. | |
| Program * | getProgram (int index) |
| Returns a given program. | |
| void | addSupervisor (SimSupervisor *supervis) |
| adds a supervisor. | |
| void | addExecSupervisor (ExecSupervisor *es) |
| adds another. | |
| void | getPosBefore (rint &x, rint &y, rint dir) |
| Moves the given coordinates by one field to the given direction. | |
Public Attributes | |
| const ErrorHandler * | errHandler |
| const Globals & | glob |
| global constants (timings etc.). | |
| rint | vars [simVarLength] |
| global vars (PUB, $FIELDS, etc.). | |
| rint | fieldWidth |
| rint | fieldHeight |
| lrt::Array< Bot * > | field |
| for position-based access. | |
| lrt::List< Bot * > | bots |
| for exec() and all walkthrough access. | |
| unsigned long | curCycle |
| current game time. | |
Friends | |
| class | Task |
Use run() to run the simulation.