1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 
3 #ifndef GAME_DATA_H
4 #define GAME_DATA_H
5 
6 #include <string>
7 #include <vector>
8 #include <boost/shared_ptr.hpp>
9 #include <boost/cstdint.hpp>
10 
11 namespace netcode {
12 	class RawPacket;
13 }
14 
15 class GameData
16 {
17 public:
18 	GameData();
19 	GameData(boost::shared_ptr<const netcode::RawPacket> pckt);
20 
21 	const netcode::RawPacket* Pack() const;
22 
23 	void SetSetup(const std::string& newSetup);
24 	void SetMapChecksum(const unsigned checksum);
25 	void SetModChecksum(const unsigned checksum);
26 	void SetRandomSeed(const unsigned seed);
27 
GetSetup()28 	const std::string& GetSetup() const { return setupText; }
GetMapChecksum()29 	unsigned GetMapChecksum() const { return mapChecksum; }
GetModChecksum()30 	unsigned GetModChecksum() const { return modChecksum; }
GetRandomSeed()31 	unsigned GetRandomSeed() const { return randomSeed; }
32 
33 private:
34 	std::string setupText;
35 	mutable std::vector<boost::uint8_t> compressed;
36 
37 	unsigned mapChecksum;
38 	unsigned modChecksum;
39 	unsigned randomSeed;
40 };
41 
42 #endif // GAME_DATA_H
43