30 #ifndef _Gamestate_H__ 31 #define _Gamestate_H__ 65 { assert(data_);
return *(uint32_t*)(data_+4); }
67 { assert(data_); *(uint32_t*)(data_+4) = id; }
70 { assert(data_);
return *(uint32_t*)(data_+8); }
72 { assert(data_); *(uint32_t*)(data_+8) = id; }
75 { assert(data_);
return *(uint32_t*)(data_+12); }
77 { assert(data_); *(uint32_t*)(data_+12) = size; }
80 { assert(data_);
return *(uint32_t*)(data_+16); }
82 { assert(data_); *(uint32_t*)(data_+16) = size; }
85 { assert(data_);
return *(int8_t*)(data_+20) & 0x1; }
87 { assert(data_); *(int8_t*)(data_+20) = (b<<0) | (*(int8_t*)(data_+20) & 0x6 ); }
90 { assert(data_);
return *(int8_t*)(data_+20) & 0x2; }
92 { assert(data_); *(int8_t*)(data_+20) = (b<<1) | (*(int8_t*)(data_+20) & 0x5 ); }
95 { assert(data_);
return *(int8_t*)(data_+20) & 0x4; }
97 { assert(data_); *(int8_t*)(data_+20) = (b<<2) | (*(int8_t*)(data_+20) & 0x3 ); }
100 { assert(data_); assert(h.
data_); memcpy( data_, h.
data_, getSize()); }
113 Gamestate(uint8_t *data,
unsigned int clientID);
119 bool collectData(
int id, uint8_t mode=0x0);
120 bool spreadData( uint8_t mode=0x0);
121 inline uint32_t
getID()
const {
return header_.getID(); }
122 inline bool isDiffed()
const {
return header_.isDiffed(); }
124 inline int32_t
getBaseID()
const {
return header_.getBaseID(); }
125 inline uint32_t
getDataSize()
const {
return header_.getDataSize(); }
129 bool decompressData();
135 virtual uint32_t getSize()
const override;
137 uint32_t calcGamestateSize(uint32_t
id, uint8_t mode=0x0);
std::vector< uint32_t > sizes_
Definition: Gamestate.h:141
Shared library macros, enums, constants and forward declarations for the network library ...
bool isDiffed() const
Definition: Gamestate.h:122
uint32_t getDataSize() const
Definition: Gamestate.h:125
std::list< obj > dataVector_
Definition: Gamestate.h:139
uint32_t getID() const
Definition: Gamestate.h:121
static constexpr uint8_t GAMESTATE_MODE_CLIENT
Definition: Gamestate.h:51
Definition: Gamestate.h:109
int32_t getBaseID() const
Definition: Gamestate.h:124
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _NetworkExport
Definition: NetworkPrereqs.h:59
Type
Definition: Packet.h:46
GamestateHeader header_
Definition: Gamestate.h:140
constexpr bool operator==(bool x, tribool y)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: tribool.h:117
bool isCompressed() const
Definition: Gamestate.h:123
static constexpr uint8_t GAMESTATE_MODE_SERVER
Definition: Gamestate.h:50
uint32_t nrOfVariables_
Definition: Gamestate.h:142
Base class of Server and Client This is the Base class of the Server and Client classes.
Definition: Host.h:52