Number Crush  1.0
..
type.h
Go to the documentation of this file.
1 #ifndef TYPE_H
2 #define TYPE_H
3 
12 #include <string>
13 #include <vector>
14 #include <map>
15 
19 typedef std::vector <unsigned> CVLine;
20 
25 typedef std::vector <CVLine> CMat;
26 
30 typedef std::pair <unsigned, unsigned> CPosition;
31 
35 struct CMyParam {
37  std::map <std::string, char> MapParamChar;
39  std::map <std::string, unsigned> MapParamUnsigned;
41  std::map <std::string, std::string> MapParamString;
42 };
43 
47 struct AuthorizedKey {
49  const std::vector <std::string> VParamChar {"KeyUp", "KeyDown", "KeyLeft", "KeyRight"};
51  const std::vector <std::string> VParamString {"LineColor", "RowColor", "IndexColor", "MyColor"};
53  const std::vector <std::string> VParamUnsigned {"GridSize"};
54 };
55 
60 
65 const std::map <std::string, std::string> KColor
66 {
67  {"KReset", "0"},
68  {"KBlack", "30"},
69  {"KRed", "31"},
70  {"KGreen", "32"},
71  {"KYellow", "33"},
72  {"KBlue", "34"},
73  {"KMAgenta", "35"},
74  {"KCyan", "36"},
75 
76 };
77 
78 #endif // TYPE_H
std::map< std::string, char > MapParamChar
Definition: type.h:37
Struct containing all the authorized keys in the struct CMyParam.
Definition: type.h:47
std::vector< unsigned > CVLine
CVLine : alias to a line of the matrix.
Definition: type.h:19
std::map< std::string, unsigned > MapParamUnsigned
Definition: type.h:39
std::map< std::string, std::string > MapParamString
Definition: type.h:41
std::pair< unsigned, unsigned > CPosition
CPosition : a pair gathering the coordinates in the grid.
Definition: type.h:30
Struct containing all the game&#39;s parameters.
Definition: type.h:35
std::vector< CVLine > CMat
CMat : alias to a game grid type.
Definition: type.h:25
const std::map< std::string, std::string > KColor
KColor : map between the "human" color and its correspondence for the Unix terminal.
Definition: type.h:66
const AuthorizedKey KAuthorizedKey
KAuthorizedKey.
Definition: type.h:59