public class Interpreter
extends java.lang.Object
Used for processing a whole fight between two or more RedCode warriors on a predefined playing field (core).
| Constructor and Description |
|---|
Interpreter(int coreSize,
int maxCycles,
int maxLength,
java.util.ArrayList<Warrior> warriors,
java.lang.String logName,
java.util.Queue<CoreChange> coreChangeQueue)
Interpreter
Initializes a playing field (core) with its predetermined size, checks if all warriors fit in, sets them and
initializes a marker field
|
| Modifier and Type | Method and Description |
|---|---|
GameHistory |
getGameHistory()
getGameHistory
|
void |
startGame()
startGame
Processes the actual game on the playing field (core) in a loop until one player wins or the counter limit is
reached (DRAW).
|
public Interpreter(int coreSize,
int maxCycles,
int maxLength,
java.util.ArrayList<Warrior> warriors,
java.lang.String logName,
java.util.Queue<CoreChange> coreChangeQueue)
Initializes a playing field (core) with its predetermined size, checks if all warriors fit in, sets them and initializes a marker field
coreSize - - committed size of the playing field (core)maxCycles - - committed number of maximum cycles until drawwarriors - - list of warriors playing against each otherlogName - - committed name extension for the war log for distinguishing logs in a hill server environmentmaxLength - - committed maximal length of a competing warriorcoreChangeQueue - - committed queue for enqueuing core changes throughout a gamepublic GameHistory getGameHistory()
public void startGame()
Processes the actual game on the playing field (core) in a loop until one player wins or the counter limit is reached (DRAW).
counterLimit - defines a maximum amount of cycles until games outcome is a draw if the game loop could not
be executed, a error message is logged into TechnicalLogTechnicalLog