#include <GlobalCoordinator.h>
Public Member Functions | |
virtual void | initialize () |
virtual void | handleMessage (cMessage *msg) |
virtual | ~GlobalCoordinator () |
void | increasePositionSize () |
void | increasePeerCount () |
int | getPeerCount () |
Vector2D & | getPosition (int k) |
void | setPosition (int k, const Vector2D &Position) |
unsigned int | getSeed () |
Protected Attributes | |
Vector2D * | Position |
int | PositionSize |
int | PeerCount |
unsigned int | Seed |
Definition at line 32 of file GlobalCoordinator.h.
GlobalCoordinator::~GlobalCoordinator | ( | ) | [virtual] |
Definition at line 38 of file GlobalCoordinator.cc.
00039 { 00040 delete[] this->Position; 00041 }
int GlobalCoordinator::getPeerCount | ( | ) |
Definition at line 66 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
00067 { 00068 Enter_Method_Silent(); 00069 return PeerCount; 00070 }
Vector2D & GlobalCoordinator::getPosition | ( | int | k | ) |
Definition at line 72 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), groupRoaming::groupRoaming(), and groupRoaming::move().
00073 { 00074 Enter_Method_Silent(); 00075 if(k >= PositionSize || k < 0) { 00076 throw cRuntimeError("Array out of bounds exception! getPosition(%d)", k); 00077 } 00078 return Position[k]; 00079 }
unsigned int GlobalCoordinator::getSeed | ( | ) |
Definition at line 90 of file GlobalCoordinator.cc.
Referenced by SimpleGameClient::handleRealworldPacket(), and MovementGenerator::MovementGenerator().
00091 { 00092 return Seed; 00093 }
void GlobalCoordinator::handleMessage | ( | cMessage * | msg | ) | [virtual] |
Definition at line 43 of file GlobalCoordinator.cc.
00044 { 00045 error("this module doesn't handle messages, it runs only in initialize()"); 00046 }
void GlobalCoordinator::increasePeerCount | ( | ) |
Definition at line 60 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
00061 { 00062 Enter_Method_Silent(); 00063 PeerCount++; 00064 }
void GlobalCoordinator::increasePositionSize | ( | ) |
Definition at line 48 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
00049 { 00050 Enter_Method_Silent(); 00051 PositionSize++; 00052 Vector2D *Temp = new Vector2D[PositionSize]; 00053 for(int i=0; i<PositionSize-1; i++) 00054 Temp[i] = this->Position[i]; 00055 00056 delete[] this->Position; 00057 this->Position = Temp; 00058 }
void GlobalCoordinator::initialize | ( | ) | [virtual] |
Definition at line 28 of file GlobalCoordinator.cc.
00029 { 00030 PositionSize = 0; 00031 PeerCount = 0; 00032 Position = NULL; 00033 Seed = par("seed"); 00034 00035 WATCH(PositionSize); 00036 }
void GlobalCoordinator::setPosition | ( | int | k, | |
const Vector2D & | Position | |||
) |
Definition at line 81 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), groupRoaming::groupRoaming(), and groupRoaming::move().
00082 { 00083 Enter_Method_Silent(); 00084 if(k >= PositionSize || k < 0) { 00085 throw cRuntimeError("Array out of bounds exception! setPosition(%d, ...)", k); 00086 } 00087 this->Position[k] = Position; 00088 }
int GlobalCoordinator::PeerCount [protected] |
Definition at line 49 of file GlobalCoordinator.h.
Referenced by getPeerCount(), increasePeerCount(), and initialize().
Vector2D* GlobalCoordinator::Position [protected] |
Definition at line 48 of file GlobalCoordinator.h.
Referenced by getPosition(), increasePositionSize(), initialize(), and ~GlobalCoordinator().
int GlobalCoordinator::PositionSize [protected] |
Definition at line 49 of file GlobalCoordinator.h.
Referenced by getPosition(), increasePositionSize(), initialize(), and setPosition().
unsigned int GlobalCoordinator::Seed [protected] |
Definition at line 50 of file GlobalCoordinator.h.
Referenced by getSeed(), and initialize().