#include <engine_two.h>
Inheritance diagram for EngineTwo:


Public Types | |
| enum | MoveState { FirstPlayerTurn = 0, SecondPlayerTurn = 1 } |
| Move phase states. More... | |
Public Slots | |
| virtual void | playerInput (int inputId, int playerNumber, int cardNumber) |
| Player input available. | |
| bool | isLegalMove (int card1, int card2, int playerNumber) |
| Check whether the two cards played are legal, supposed the given player is the second one. | |
| int | whoWonMove (int card1, int card2) |
| Check who won a move, the first or the second card. | |
Public Member Functions | |
| EngineTwo (QWidget *parent, Deck *deck, DisplayTwo *display) | |
| Constructor for the game engine. | |
| virtual void | startGame (Suite trump, int startPlayer) |
| Start a new game. | |
| virtual void | stopGame () |
| Stop a game. | |
| MoveState | currentMovePhase () |
| Retrieve the current move phase. | |
| int | playedCard (int no) |
| Retrieve the currently played card. | |
Protected Slots | |
| void | gameLoopStart () |
| First part of the game loop. | |
| void | gameLoopFinish () |
| Second part of the game loop. | |
Protected Member Functions | |
| void | activatePlayer (int playerNumber) |
| Active the current player to the given player number. | |
| bool | gameOver () |
| Check whether the game is over. | |
| int | evaluateGame () |
| Called after game ends and then give points to players. | |
Definition at line 42 of file engine_two.h.
|
|
Move phase states.
Definition at line 48 of file engine_two.h. |
|
||||||||||||||||
|
Constructor for the game engine.
Definition at line 37 of file engine_two.cpp. References AbstractEngine::mCurrentPlayer. |
|
|
Active the current player to the given player number. Enable inputs etc.
Definition at line 374 of file engine_two.cpp. References AbstractEngine::mPlayers. Referenced by gameLoopStart(). |
|
|
Retrieve the current move phase.
Definition at line 73 of file engine_two.h. |
|
|
Called after game ends and then give points to players.
Definition at line 229 of file engine_two.cpp. References Player::addGame(), Player::addScore(), Player::addWonGame(), AbstractEngine::mPlayers, Player::name(), Player::points(), DisplayTwo::showScore(), and DisplayTwo::showText(). Referenced by gameLoopFinish(). Here is the call graph for this function: ![]() |
|
|
Second part of the game loop.
Definition at line 149 of file engine_two.cpp. References Player::addWonCard(), evaluateGame(), FirstPlayerTurn, gameLoopStart(), gameOver(), global_debug, Player::increaseMovesWon(), AbstractEngine::isGameRunning(), AbstractEngine::mCurrentPlayer, AbstractEngine::mGameStatus, AbstractEngine::mPlayers, Player::noOfMovesWon(), AbstractEngine::player(), Player::points(), DisplayTwo::remove(), SecondPlayerTurn, DisplayTwo::showMove(), AbstractEngine::signalGameOver(), AbstractEngine::Stopped, and whoWonMove(). Referenced by playerInput(). |
|
|
First part of the game loop.
Definition at line 47 of file engine_two.cpp. References activatePlayer(), AbstractEngine::isGameRunning(), and AbstractEngine::mCurrentPlayer. Referenced by gameLoopFinish(). |
|
|
Check whether the game is over.
Definition at line 219 of file engine_two.cpp. References global_debug. Referenced by gameLoopFinish(). |
|
||||||||||||||||
|
Check whether the two cards played are legal, supposed the given player is the second one.
Definition at line 395 of file engine_two.cpp. References Player::getCard(), Deck::getCardType(), Deck::getSuite(), CardDeck::Jack, and AbstractEngine::player(). Referenced by playerInput(). |
|
|
Retrieve the currently played card.
Definition at line 79 of file engine_two.h. |
|
||||||||||||||||
|
Player input available.
Implements AbstractEngine. Definition at line 58 of file engine_two.cpp. References Player::deleteCard(), FirstPlayerTurn, gameLoopFinish(), Player::getCard(), Deck::getCardType(), Deck::getSuite(), global_debug, isLegalMove(), AbstractEngine::mCurrentPlayer, AbstractEngine::mPlayers, Deck::name(), DisplayTwo::play(), AbstractEngine::player(), SecondPlayerTurn, Player::stopTurn(), TIME_END_MOVE, and DisplayTwo::turn(). |
|
||||||||||||
|
Start a new game.
Implements AbstractEngine. Definition at line 319 of file engine_two.cpp. References Player::addGame(), DisplayTwo::deal(), FirstPlayerTurn, AbstractEngine::mCurrentPlayer, AbstractEngine::mGameStatus, AbstractEngine::mPlayers, AbstractEngine::player(), and AbstractEngine::Running. Here is the call graph for this function: ![]() |
|
|
Stop a game.
Implements AbstractEngine. Definition at line 350 of file engine_two.cpp. References AbstractEngine::mPlayers. |
|
||||||||||||
|
Check who won a move, the first or the second card.
Definition at line 450 of file engine_two.cpp. References CardDeck::Ace, Deck::getCardType(), Deck::getSuite(), global_debug, CardDeck::Jack, and CardDeck::Ten. Referenced by gameLoopFinish(). |
1.4.6