Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
The definition for the object that acts as the interface between the game controller and any systems or objects interested in interacting with it. More...
#include <ur_controller.hpp>
Public Member Functions | |
PlayerID | getPlayer () const |
Gets the ID of the player associated with this object. | |
void | attemptLaunchPiece (PieceTypeID pieceType, glm::u8vec2 launchLocation=glm::u8vec2{0, 0}) |
Attempts to launch a game piece to some location on the game board. | |
void | attemptMoveBoardPiece (PieceIdentity piece) |
Attempts to move a piece already on the board to a new location based on the current dice roll. | |
void | attemptNextTurn () |
Attempts to end the current turn and begin the next one. | |
void | attemptDiceRoll () |
Attempts to roll the dice. | |
const GameOfUrModel & | getModel () |
Gets a constant reference to the underlying data model used by UrController. | |
Private Member Functions | |
UrPlayerControls (PlayerID player, UrController &urController) | |
Constructs a new UrPlayerControls object. | |
Static Private Member Functions | |
static std::unique_ptr< UrPlayerControls > | create (PlayerID player, UrController &urController) |
Creates an instance of UrPlayerControls. | |
Private Attributes | |
PlayerID | mPlayer |
The ID of the player to whom these controls belong. | |
UrController & | mUrController |
The reference to the game controller connected with these controls. | |
Friends | |
class | UrController |
The definition for the object that acts as the interface between the game controller and any systems or objects interested in interacting with it.
Contains methods for prompting updates in the state of the game data model managed by the controller. Each instance of this represents a single player playing the game.
|
inlineprivate |
Constructs a new UrPlayerControls object.
player | The player to whom these controls belong. |
urController | The reference to the game controller connected with these controls. |
void UrPlayerControls::attemptLaunchPiece | ( | PieceTypeID | pieceType, |
glm::u8vec2 | launchLocation = glm::u8vec2{0,0} ) |
Attempts to launch a game piece to some location on the game board.
pieceType | The type of piece being launched. |
launchLocation | The location on the board to which the piece is being launched. |
void UrPlayerControls::attemptMoveBoardPiece | ( | PieceIdentity | piece | ) |
Attempts to move a piece already on the board to a new location based on the current dice roll.
piece | The type of piece being moved. |
|
inlinestaticprivate |
Creates an instance of UrPlayerControls.
player | The player to whom these controls belong. |
urController | The reference to the game controller connected with these controls. |
|
inline |
Gets a constant reference to the underlying data model used by UrController.
|
inline |
Gets the ID of the player associated with this object.