Number Crush  1.0
..
game.h
Go to the documentation of this file.
1 
2 #ifndef GAME_H
3 #define GAME_H
4 
14 #include "Correc_prof/type.h"
15 
23 void Menu (CPosition & Pos, char & Direction, const CMyParam & Params);
24 
34 void MakeAMove (CMat & Grid, const CPosition & Pos, const char & Direction, const CMyParam & Params);
35 
44 bool AtLeastThreeInARow (const CMat & Mat, CPosition & Pos, unsigned & HowMany);
45 
54 bool AtLeastThreeInAColumn (const CMat & Mat, CPosition & Pos, unsigned & HowMany);
55 
63 void RemovalInColumn (CMat & Mat, const CPosition & Pos, const unsigned & HowMany);
64 
72 void RemovalInRow (CMat & Mat, const CPosition & Pos, const unsigned & HowMany);
73 
79 unsigned ComputeScore (const unsigned & HowMany);
80 
86 int ppal ();
87 #endif // GAME_H
bool AtLeastThreeInAColumn(const CMat &Mat, CPosition &Pos, unsigned &HowMany)
Chek if there is at least 3 token in the same column.
Definition: game.cpp:65
bool AtLeastThreeInARow(const CMat &Mat, CPosition &Pos, unsigned &HowMany)
Chek if there is at least 3 token in the same row.
Definition: game.cpp:47
void RemovalInColumn(CMat &Mat, const CPosition &Pos, const unsigned &HowMany)
Remove "Howmany" same tokens starting from "Pos".
Definition: game.cpp:84
unsigned ComputeScore(const unsigned &HowMany)
Computer the score.
Definition: game.cpp:106
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
int ppal()
new main
Definition: game.cpp:111
void RemovalInRow(CMat &Mat, const CPosition &Pos, const unsigned &HowMany)
Remove "Howmany" same tokens starting from "Pos".
Definition: game.cpp:96
std::vector< CVLine > CMat
CMat : alias to a game grid type.
Definition: type.h:25
void Menu(CPosition &Pos, char &Direction, const CMyParam &Params)
Display the menu according to the set of parameters.
Definition: game.cpp:17
void MakeAMove(CMat &Grid, const CPosition &Pos, const char &Direction, const CMyParam &Params)
Swap the token from its inital place to its final destination.
Definition: game.cpp:31
Definition of usefull types or aliases for the project.