#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.
{
delete[] this->Position;
}
| int GlobalCoordinator::getPeerCount | ( | ) |
Definition at line 66 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
{
Enter_Method_Silent();
return PeerCount;
}
| Vector2D & GlobalCoordinator::getPosition | ( | int | k | ) |
Definition at line 72 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), groupRoaming::groupRoaming(), and groupRoaming::move().
{
Enter_Method_Silent();
if(k >= PositionSize || k < 0) {
throw cRuntimeError("Array out of bounds exception! getPosition(%d)", k);
}
return Position[k];
}
| unsigned int GlobalCoordinator::getSeed | ( | ) |
Definition at line 90 of file GlobalCoordinator.cc.
Referenced by SimpleGameClient::handleRealworldPacket(), and MovementGenerator::MovementGenerator().
{
return Seed;
}
| void GlobalCoordinator::handleMessage | ( | cMessage * | msg | ) | [virtual] |
Definition at line 43 of file GlobalCoordinator.cc.
{
error("this module doesn't handle messages, it runs only in initialize()");
}
| void GlobalCoordinator::increasePeerCount | ( | ) |
Definition at line 60 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
{
Enter_Method_Silent();
PeerCount++;
}
| void GlobalCoordinator::increasePositionSize | ( | ) |
Definition at line 48 of file GlobalCoordinator.cc.
Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().
{
Enter_Method_Silent();
PositionSize++;
Vector2D *Temp = new Vector2D[PositionSize];
for(int i=0; i<PositionSize-1; i++)
Temp[i] = this->Position[i];
delete[] this->Position;
this->Position = Temp;
}
| void GlobalCoordinator::initialize | ( | ) | [virtual] |
Definition at line 28 of file GlobalCoordinator.cc.
{
PositionSize = 0;
PeerCount = 0;
Position = NULL;
Seed = par("seed");
WATCH(PositionSize);
}
| 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().
{
Enter_Method_Silent();
if(k >= PositionSize || k < 0) {
throw cRuntimeError("Array out of bounds exception! setPosition(%d, ...)", k);
}
this->Position[k] = Position;
}
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().
1.7.1