public class CommandPointer
extends java.lang.Object
For holding the current pointer on the playing field for possibly multiple processes corresponding to one player.
Also holds information about in which round the player died.
| Modifier | Constructor and Description |
|---|---|
protected |
CommandPointer(int startPosition)
CommandPointer
Initializes a command pointer for one player with its starting position and adds it to the process list.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addProcess(int id)
addProcess
Adds a process to the process list for one player
|
protected int |
getCurrentProcessPointer()
getCurrentProcessPointer
|
protected int |
nextProcess()
nextProcess
calculates the next process to be called for one player
|
protected void |
setNextInstruction(int id)
setNextInstruction
sets the next process to be called for one player
|
protected CommandPointer(int startPosition)
Initializes a command pointer for one player with its starting position and adds it to the process list.
startPosition - defines starting position for one player where the first instruction of its warrior is to be
processed with the start of the game.protected int getCurrentProcessPointer()
protected int nextProcess()
calculates the next process to be called for one player
protected void setNextInstruction(int id)
sets the next process to be called for one player
id - defines the position of the playing field to be processed saved in one process of the process listprotected void addProcess(int id)
Adds a process to the process list for one player
id - defines the position of the playing field (core) to be processed saved in one process of the process
list