polish Log
[Tsunagari.git] / src / common.h
blob3527870bc333c236dc2ac831f24a1dee7f86f103
1 /******************************
2 ** Tsunagari Tile Engine **
3 ** common.h **
4 ** Copyright 2011 OmegaSDG **
5 ******************************/
7 #ifndef COMMON_H
8 #define COMMON_H
10 #include <string>
11 #include <vector>
13 #include "log.h" // for message_mode_t
15 //! Game Movement Mode
16 enum movement_mode_t {
17 TURN,
18 TILE,
19 NOTILE
22 //! Coordinate Type
23 struct coord_t {
24 long x;
25 long y;
26 long z;
29 //! coord_t constructor
30 coord_t coord(long x, long y, long z);
32 //! 3D Cube Type
33 struct cube_t {
34 long x1, x2;
35 long y1, y2;
36 long z1, z2;
39 //! cube_t constructor
40 cube_t cube(long x1, long y1, long z1,
41 long x2, long y2, long z2);
43 //! Client Configuration
44 struct ClientValues {
45 std::string world;
46 movement_mode_t movemode;
47 coord_t windowsize;
48 bool fullscreen;
49 bool cache_enabled;
50 int cache_ttl;
51 int cache_size;
52 message_mode_t loglevel;
55 //! Returns a bool from a "true"/"false" string.
56 bool parseBool(const std::string& s);
58 //! Split a string by a delimiter.
59 std::vector<std::string> splitStr(std::string str,
60 const std::string& delimiter);
62 //! Convert an integer to a representative string.
63 std::string itostr(long in);
65 #endif