OverSim
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
SimpleGameClient.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH)
3
//
4
// This program is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU General Public License
6
// as published by the Free Software Foundation; either version 2
7
// of the License, or (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
//
18
25
#ifndef __SIMPLEGAMECLIENT_H_
26
#define __SIMPLEGAMECLIENT_H_
27
28
#include <map>
29
#include <string>
30
31
#include <
tunoutscheduler.h
>
32
#include <
realtimescheduler.h
>
33
34
#include <
Vector2D.h
>
35
#include <
BaseApp.h
>
36
37
#include <
GlobalCoordinator.h
>
38
#include <
GlobalStatisticsAccess.h
>
39
#include <
MovementGenerator.h
>
40
#include <
randomRoaming.h
>
41
#include <
groupRoaming.h
>
42
#include <
hotspotRoaming.h
>
43
#include <
traverseRoaming.h
>
44
#include <
greatGathering.h
>
45
#include <
realWorldRoaming.h
>
46
#include "
SCPacket.h
"
47
#include "
SimpleGameClient_m.h
"
48
49
51
55
class
SimpleGameClient
:
public
BaseApp
56
{
57
public
:
58
// OMNeT++
59
virtual
~SimpleGameClient
();
60
virtual
void
initializeApp
(
int
stage);
61
virtual
void
handleTimerEvent
(cMessage* msg);
62
virtual
void
handleLowerMessage
(cMessage* msg);
63
virtual
void
handleReadyMessage
(
CompReadyMessage
* msg);
64
virtual
void
finishApp
();
65
66
Vector2D
getPosition
() {
return
position
;};
67
double
getAOI
() {
return
AOIWidth
;};
68
bool
isOverlayReady
() {
return
overlayReady
;};
69
NodeHandle
getThisNode
() {
return
overlay
->
getThisNode
();};
70
71
NeighborMap
Neighbors
;
72
73
protected
:
74
GlobalCoordinator
*
coordinator
;
75
CollisionList
CollisionRect
;
76
77
void
updateNeighbors
(
GameAPIListMessage
* sgcMsg);
78
void
updatePosition
();
79
80
// parameters
81
simtime_t
movementDelay
;
82
double
areaDimension
,
movementSpeed
,
movementRate
,
AOIWidth
;
83
bool
useScenery
;
84
bool
overlayReady
;
85
Vector2D
position
;
86
MovementGenerator
*
Generator
;
87
bool
logAOI
;
88
89
NeighborMap::iterator
itNeighbors
;
90
std::string
GeneratorType
;
91
92
// timers
93
cMessage*
move_timer
;
94
95
// realworld
96
void
handleRealworldPacket
(
char
*buf, uint32_t len);
97
cMessage*
packetNotification
;
// used by TunOutScheduler to notify about new packets
98
PacketBuffer
packetBuffer
;
// received packets are stored here
99
RealtimeScheduler
*
scheduler
;
100
unsigned
int
mtu
;
101
SOCKET
appFd
;
102
bool
doRealworld
;
103
bool
frozen
;
104
105
// AOI measuring / hotspots
106
double
startAOI
;
107
bool
useHotspots
;
108
bool
lastInHotspot
;
109
bool
lastFarFromHotspot
;
110
simtime_t
lastAOImeasure
;
111
double
avgAOI
;
112
simtime_t
nonHotspotTime
;
113
simtime_t
farFromHotspotTime
;
114
double
avgFarFromHotspotAOI
;
115
simtime_t
hotspotTime
;
116
double
avgHotspotAOI
;
117
};
118
119
#endif
src
applications
simplegameclient
SimpleGameClient.h
Generated on Fri Dec 7 2012 13:37:53 for OverSim by
1.8.1.2