Main Page | Class List | File List | Class Members | File Members

instructions.h File Reference

#include "common.h"
#include "virtualMachine.h"
#include "program.h"
#include "instructions.h"
#include "world.h"

Include dependency graph for instructions.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define process2entity(PROC)   *static_cast<entity*>(&(PROC.getProgram()))
 convert a process to an entity

#define vm2world(VM)   *static_cast<world*>(&VM)
 convert from a virtual machine to a world


Functions

void instr_null (virtualMachine &vm, process &proc, thread &t)
 do nothing

void instr_and (virtualMachine &vm, process &proc, thread &t)
 logically AND two values and store the result

void instr_or (virtualMachine &vm, process &proc, thread &t)
 logically OR two values and store the result

void instr_copy (virtualMachine &vm, process &proc, thread &t)
 copy data between addresses

void instr_increment (virtualMachine &vm, process &proc, thread &t)
 increment a value

void instr_decrement (virtualMachine &vm, process &proc, thread &t)
 decrement a value

void instr_add (virtualMachine &vm, process &proc, thread &t)
 sum two values and store the result

void instr_sub (virtualMachine &vm, process &proc, thread &t)
 subtract two values and store the result

void instr_switch (virtualMachine &vm, process &proc, thread &t)
 test a value to determine the next instruction to execute

void instr_spawnThread (virtualMachine &vm, process &proc, thread &t)
 spawn a new thread

void instr_killThread (virtualMachine &vm, process &proc, thread &t)
 kill a thread

void instr_moveFoward (virtualMachine &vm, process &proc, thread &t)
 move foward

void instr_rotate (virtualMachine &vm, process &proc, thread &t)
 rotate left or right

void instr_transferEnergy (virtualMachine &vm, process &proc, thread &t)
 transfer energy to another entity

void instr_absorbEnergy (virtualMachine &vm, process &proc, thread &t)
 absorb energy from the world

void instr_giveMemory (virtualMachine &vm, process &proc, thread &t)
 transfer memory to the entity/tile infront

void instr_takeMemory (virtualMachine &vm, process &proc, thread &t)
 take memory from the entity infront

void instr_convertEnergyToMemory (virtualMachine &vm, process &proc, thread &t)
 convert energy to memory

void instr_convertMemoryToEnergy (virtualMachine &vm, process &proc, thread &t)
 convert memory to energy


Define Documentation

#define process2entity PROC   )     *static_cast<entity*>(&(PROC.getProgram()))
 

convert a process to an entity

Definition at line 17 of file instructions.h.

#define vm2world VM   )     *static_cast<world*>(&VM)
 

convert from a virtual machine to a world

Definition at line 20 of file instructions.h.


Function Documentation

void instr_absorbEnergy virtualMachine &  vm,
process &  proc,
thread &  t
 

absorb energy from the world

Definition at line 370 of file instructions.cpp.

References world::absorbEnergy(), process2entity, and vm2world.

Referenced by initWorld().

void instr_add virtualMachine &  vm,
process &  proc,
thread &  t
 

sum two values and store the result

Definition at line 155 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_and virtualMachine &  vm,
process &  proc,
thread &  t
 

logically AND two values and store the result

Definition at line 48 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

void instr_convertEnergyToMemory virtualMachine &  vm,
process &  proc,
thread &  t
 

convert energy to memory

Definition at line 423 of file instructions.cpp.

References world::convertEnergyToMemory(), energy, process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_convertMemoryToEnergy virtualMachine &  vm,
process &  proc,
thread &  t
 

convert memory to energy

Definition at line 443 of file instructions.cpp.

References world::convertMemoryToEnergy(), process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_copy virtualMachine &  vm,
process &  proc,
thread &  t
 

copy data between addresses

Definition at line 106 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_decrement virtualMachine &  vm,
process &  proc,
thread &  t
 

decrement a value

Definition at line 131 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_giveMemory virtualMachine &  vm,
process &  proc,
thread &  t
 

transfer memory to the entity/tile infront

Definition at line 383 of file instructions.cpp.

References world::giveMemory(), process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_increment virtualMachine &  vm,
process &  proc,
thread &  t
 

increment a value

Definition at line 25 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_killThread virtualMachine &  vm,
process &  proc,
thread &  t
 

kill a thread

Definition at line 277 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_moveFoward virtualMachine &  vm,
process &  proc,
thread &  t
 

move foward

Definition at line 307 of file instructions.cpp.

References world::moveEntity(), process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_null virtualMachine &  vm,
process &  proc,
thread &  t
 

do nothing

Definition at line 12 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_or virtualMachine &  vm,
process &  proc,
thread &  t
 

logically OR two values and store the result

Definition at line 77 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

void instr_rotate virtualMachine &  vm,
process &  proc,
thread &  t
 

rotate left or right

Definition at line 323 of file instructions.cpp.

References process2entity, world::releaseEnergy(), world::rotateEntityLeft(), world::rotateEntityRight(), and vm2world.

Referenced by initWorld().

void instr_spawnThread virtualMachine &  vm,
process &  proc,
thread &  t
 

spawn a new thread

Definition at line 247 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_sub virtualMachine &  vm,
process &  proc,
thread &  t
 

subtract two values and store the result

Definition at line 184 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_switch virtualMachine &  vm,
process &  proc,
thread &  t
 

test a value to determine the next instruction to execute

Definition at line 217 of file instructions.cpp.

References process2entity, world::releaseEnergy(), and vm2world.

Referenced by initWorld().

void instr_takeMemory virtualMachine &  vm,
process &  proc,
thread &  t
 

take memory from the entity infront

Definition at line 403 of file instructions.cpp.

References process2entity, world::releaseEnergy(), world::takeMemory(), and vm2world.

Referenced by initWorld().

void instr_transferEnergy virtualMachine &  vm,
process &  proc,
thread &  t
 

transfer energy to another entity

Definition at line 350 of file instructions.cpp.

References energy, process2entity, world::releaseEnergy(), world::transferEnergy(), and vm2world.

Referenced by initWorld().


Generated on Sun Mar 6 22:11:26 2005 for experiment03 by doxygen 1.3.7