class ClientGameEngine -
More...
#include <ClientGameEngine.hpp>
|
| ClientGameEngine () |
| Constructor. More...
|
|
void | handleInformation (int x, int y) |
| Print where the user click on the GameWindow. More...
|
|
void | handleQuitMenu (bool quitDef=false) |
| Change the Window for nothing, Menu or Game. More...
|
|
void | renderGame () |
| Loop that manage the entire Engine.
|
|
void | startMenuWindow () |
| Start the loop that manage the MenuWindow.
|
|
void | startGameWindow () |
| Start the loop that manage the GameWindow.
|
|
void | playGame () |
| Loop that is used when the client is in GameMode.
|
|
void | playMenu () |
| Loop that is used when the client is in MenuMode.
|
|
bool | connect (const std::string &serverAddress, int serverPort) |
|
void | startReceiving () |
|
void | registerServerAnswer (const std::string &response) |
|
void | processServerRequest (std::string request) |
|
void | askServer () |
|
bool | tryConnection (std::string id, std::string username, std::string server, std::string port) |
| A player is connecting to a Game. More...
|
|
bool | intersectPointRect (sf::Vector2i point, sf::FloatRect rectangle) |
| Detect an intersection between a point and a rect. More...
|
|
void | handlePriorityCardPlay (std::string typePlayed, int difficulty, int boxes) |
| Print which priority card the user wants to play and its difficulty. More...
|
|
void | printChat (const std::string &message) |
|
void | processMessage (boost::asio::streambuf &receiveBuffer) |
|
void | generateMap (const unsigned height, const unsigned width, const int seed) |
|
void | loadMap () |
|
void | playTurn () |
|
void | waitToBeReady () |
|
void | runRule (shared::RuleArgsStruct ruleArgs) |
|
void | handleEndTurnButton () |
|
void | randomIA () |
|
|
std::shared_ptr< sf::RenderWindow > | clientWindow |
|
std::atomic< int > | runningWindow = 1 |
|
std::atomic< bool > | areTextureLoaded = false |
|
std::unique_ptr< GameWindow > | clientGame = nullptr |
|
std::unique_ptr< MenuWindow > | clientMenu = nullptr |
|
std::vector< int > | map |
|
int | turn = 0 |
|
std::shared_ptr< shared::Player > | myself |
|
std::string | gameId = "new" |
|
std::atomic< bool > | clientConnectedAndReady |
|
std::string | serverGameId |
|
shared::RuleArgsStruct | ruleArgsStruct |
|
std::atomic< bool > | endOfTurn |
|
std::vector< std::shared_ptr< shared::Player > > | otherPlayers |
|
std::atomic< bool > | IATurn |
|
◆ ClientGameEngine()
ClientGameEngine::ClientGameEngine |
( |
| ) |
|
◆ handleInformation()
void ClientGameEngine::handleInformation |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Print where the user click on the GameWindow.
- Parameters
-
x | position on x axis |
y | position on y axis |
◆ handlePriorityCardPlay()
void ClientGameEngine::handlePriorityCardPlay |
( |
std::string |
typePlayed, |
|
|
int |
difficulty, |
|
|
int |
boxes |
|
) |
| |
Print which priority card the user wants to play and its difficulty.
- Parameters
-
typePlayed | type of the priority card played (economy, science, culture, ...) |
difficulty | level of difficulty played (0 to 4 for the 5 fields) |
◆ handleQuitMenu()
void ClientGameEngine::handleQuitMenu |
( |
bool |
quitDef = false | ) |
|
Change the Window for nothing, Menu or Game.
- Parameters
-
quitDef | if quitDef is true, the game stop, else it change Menu to Game |
◆ intersectPointRect()
bool ClientGameEngine::intersectPointRect |
( |
sf::Vector2i |
point, |
|
|
sf::FloatRect |
rectangle |
|
) |
| |
Detect an intersection between a point and a rect.
- Parameters
-
point | the point |
rectangle | the rectangle |
◆ tryConnection()
bool ClientGameEngine::tryConnection |
( |
std::string |
id, |
|
|
std::string |
username, |
|
|
std::string |
server, |
|
|
std::string |
port |
|
) |
| |
A player is connecting to a Game.
- Parameters
-
id | game ID, = new for a new Game |
username | player username |
server | serveur adresse |
port | port number |
The documentation for this class was generated from the following files: