Number Crush  1.0
..
Functions
game.h File Reference

Set of functions usefull for the game. More...

#include "Correc_prof/type.h"
Include dependency graph for game.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void Menu (CPosition &Pos, char &Direction, const CMyParam &Params)
 Display the menu according to the set of parameters. More...
 
void MakeAMove (CMat &Grid, const CPosition &Pos, const char &Direction, const CMyParam &Params)
 Swap the token from its inital place to its final destination. More...
 
bool AtLeastThreeInARow (const CMat &Mat, CPosition &Pos, unsigned &HowMany)
 Chek if there is at least 3 token in the same row. More...
 
bool AtLeastThreeInAColumn (const CMat &Mat, CPosition &Pos, unsigned &HowMany)
 Chek if there is at least 3 token in the same column. More...
 
void RemovalInColumn (CMat &Mat, const CPosition &Pos, const unsigned &HowMany)
 Remove "Howmany" same tokens starting from "Pos". More...
 
void RemovalInRow (CMat &Mat, const CPosition &Pos, const unsigned &HowMany)
 Remove "Howmany" same tokens starting from "Pos". More...
 
unsigned ComputeScore (const unsigned &HowMany)
 Computer the score. More...
 
int ppal ()
 new main More...
 

Detailed Description

Set of functions usefull for the game.

Author
Alain Casali
Marc Laporte
Version
1.0
Date
22 Janvier 2018

Definition in file game.h.

Function Documentation

bool AtLeastThreeInAColumn ( const CMat Mat,
CPosition Pos,
unsigned &  HowMany 
)

Chek if there is at least 3 token in the same column.

Parameters
[in]Mat: Game grid
[out]Pos: Position of the first token from wich there is at least 3 times the same token in the same column
[out]HowMany: How many the same token appears consecutivelly in this column
Returns
True if there is at least 3 times the same token in the same column, false otherwise

Definition at line 65 of file game.cpp.

Here is the caller graph for this function:

bool AtLeastThreeInARow ( const CMat Mat,
CPosition Pos,
unsigned &  HowMany 
)

Chek if there is at least 3 token in the same row.

Parameters
[in]Mat: Game grid
[out]Pos: Position of the first token from wich there is at least 3 times the same token in the same row
[out]HowMany: How many the same token appears consecutivelly in this row
Returns
True if there is at least 3 times the same token in the same row, false otherwise

Definition at line 47 of file game.cpp.

Here is the caller graph for this function:

unsigned ComputeScore ( const unsigned &  HowMany)

Computer the score.

Parameters
[in]HowMany: Number of candidies removed

Definition at line 106 of file game.cpp.

Here is the caller graph for this function:

void MakeAMove ( CMat Grid,
const CPosition Pos,
const char &  Direction,
const CMyParam Params 
)

Swap the token from its inital place to its final destination.

Parameters

Definition at line 31 of file game.cpp.

Here is the caller graph for this function:

void Menu ( CPosition Pos,
char &  Direction,
const CMyParam Params 
)

Display the menu according to the set of parameters.

Parameters
[out]Pos: Position of the token to move
[out]Direction: Direction of wanted movement
[in]Params: List of usefull parameters

Definition at line 17 of file game.cpp.

Here is the caller graph for this function:

int ppal ( )

new main

Returns
0 if everything is OK

Definition at line 111 of file game.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RemovalInColumn ( CMat Mat,
const CPosition Pos,
const unsigned &  HowMany 
)

Remove "Howmany" same tokens starting from "Pos".

Parameters

Definition at line 84 of file game.cpp.

Here is the caller graph for this function:

void RemovalInRow ( CMat Mat,
const CPosition Pos,
const unsigned &  HowMany 
)

Remove "Howmany" same tokens starting from "Pos".

Parameters

Definition at line 96 of file game.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: