#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 |
void GlobalCoordinator::initialize | ( | ) | [virtual] |
00029 { 00030 PositionSize = 0; 00031 PeerCount = 0; 00032 Position = NULL; 00033 Seed = par("seed"); 00034 00035 WATCH(PositionSize); 00036 }
void GlobalCoordinator::handleMessage | ( | cMessage * | msg | ) | [virtual] |
void GlobalCoordinator::increasePositionSize | ( | ) |
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
00044 { 00045 Enter_Method_Silent(); 00046 PositionSize++; 00047 Vector2D *Temp = new Vector2D[PositionSize]; 00048 for(int i=0; i<PositionSize-1; i++) 00049 Temp[i] = this->Position[i]; 00050 00051 delete[] this->Position; 00052 this->Position = Temp; 00053 }
void GlobalCoordinator::increasePeerCount | ( | ) |
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
00056 { 00057 Enter_Method_Silent(); 00058 PeerCount++; 00059 }
int GlobalCoordinator::getPeerCount | ( | ) |
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
00062 { 00063 Enter_Method_Silent(); 00064 return PeerCount; 00065 }
Vector2D & GlobalCoordinator::getPosition | ( | int | k | ) |
Referenced by greatGathering::greatGathering(), groupRoaming::groupRoaming(), and groupRoaming::move().
00068 { 00069 Enter_Method_Silent(); 00070 if(k >= PositionSize || k < 0) { 00071 throw new cException("Array out of bounds exception! getPosition(%d)", k); 00072 } 00073 return Position[k]; 00074 }
void GlobalCoordinator::setPosition | ( | int | k, | |
const Vector2D & | Position | |||
) |
Referenced by greatGathering::greatGathering(), groupRoaming::groupRoaming(), and groupRoaming::move().
00077 { 00078 Enter_Method_Silent(); 00079 if(k >= PositionSize || k < 0) { 00080 throw new cException("Array out of bounds exception! setPosition(%d, ...)", k); 00081 } 00082 this->Position[k] = Position; 00083 }
unsigned int GlobalCoordinator::getSeed | ( | ) |
Referenced by SimpleGameClient::handleRealworldPacket(), and MovementGenerator::MovementGenerator().
00086 { 00087 return Seed; 00088 }
Vector2D* GlobalCoordinator::Position [protected] |
Referenced by getPosition(), increasePositionSize(), and initialize().
int GlobalCoordinator::PositionSize [protected] |
Referenced by getPosition(), increasePositionSize(), initialize(), and setPosition().
int GlobalCoordinator::PeerCount [protected] |
Referenced by getPeerCount(), increasePeerCount(), and initialize().
unsigned int GlobalCoordinator::Seed [protected] |
Referenced by getSeed(), and initialize().