| Package | Description |
|---|---|
| mars |
The mars package is used for running a whole game of NetWars.
|
| redHandling |
The redHandling package with its main class RedFileManager was
created to parse and transfer RedCode files or strings into a
data structure for latter computation.
|
| Modifier and Type | Method and Description |
|---|---|
protected static int |
Command.add(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
add
adds the content addressed in field A to the content addressed in field B.
|
protected static int |
Command.cmp(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
cmp
Computes a skip of the next instruction if field A equals field B
|
protected static int |
Command.djn(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
djn
it decrements the content of field B and jumps to the address in field A if B is not zero
|
protected static int |
Command.jmn(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
jmn
works like
jmp, except field B of the instruction must be not zero. |
protected static int |
Command.jmp(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
jmp
sets the instruction ID to be returned to what is addressed in field A.
|
protected static int |
Command.jmz(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
jmz
works like
jmp, except field B of the instruction must be zero. |
protected static int |
Command.mov(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core,
Marker marker,
Players playerList,
GameHistory gameHistory)
mov
replaces an existing instruction addressed in field B of the instruction with field A corresponding to its
addressing mode.
|
protected static int |
Command.slt(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
slt
Computes a skip of the next instruction if the content of field A is less than content of field B
|
protected static int |
Command.spl(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core,
Players playerList)
spl
it adds the address in field A as a new process to an alternating list of processes.
|
protected static int |
Command.sub(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
sub
subtracts the content addressed in field A from the content addressed in field B.the same instruction ID as
committed for further incrementing
|
| Modifier and Type | Method and Description |
|---|---|
protected static int |
Command.add(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
add
adds the content addressed in field A to the content addressed in field B.
|
protected static int |
Command.cmp(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
cmp
Computes a skip of the next instruction if field A equals field B
|
protected static int |
Command.djn(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
djn
it decrements the content of field B and jumps to the address in field A if B is not zero
|
protected static int |
Command.jmn(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
jmn
works like
jmp, except field B of the instruction must be not zero. |
protected static int |
Command.jmp(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
jmp
sets the instruction ID to be returned to what is addressed in field A.
|
protected static int |
Command.jmz(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
jmz
works like
jmp, except field B of the instruction must be zero. |
protected static int |
Command.mov(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core,
Marker marker,
Players playerList,
GameHistory gameHistory)
mov
replaces an existing instruction addressed in field B of the instruction with field A corresponding to its
addressing mode.
|
protected static int |
Command.slt(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
slt
Computes a skip of the next instruction if the content of field A is less than content of field B
|
protected static int |
Command.spl(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core,
Players playerList)
spl
it adds the address in field A as a new process to an alternating list of processes.
|
protected static int |
Command.sub(int instrID,
Instruction instruction,
RedCodeArrayList<Instruction> core)
sub
subtracts the content addressed in field A from the content addressed in field B.the same instruction ID as
committed for further incrementing
|
| Modifier and Type | Method and Description |
|---|---|
protected Instruction |
Warrior.getInstruction(int id)
Gets the Instruction at the passed id.
|
Instruction |
RedCodeArrayList.getInstruction(int id)
Gets Instruction at id.
|
Instruction |
RedCodeArrayList.getInstruction(int id,
int fieldAorB)
Computes the absolute address of the instruction referenced by a field
and returns the value of the new found instruction.
|
Instruction |
RedCodeArrayList.getInstructionAt(int id,
int fieldAorB)
Computes the absolute address of the instruction referenced by a field,
and of that reference again the absolute address to return its
Instruction.
|
| Modifier and Type | Method and Description |
|---|---|
protected RedCodeArrayList<Instruction> |
Warrior.getInstructionSet()
Gets the warriors InstructionSet
|