The aspect class for the UI layer of the game scene.
More...
#include <ur_ui_view.hpp>
|
|
std::shared_ptr< BaseSimObjectAspect > | clone () const override |
| |
|
void | onActivated () override |
| |
|
void | variableUpdate (uint32_t timeStep) override |
| |
|
const GameOfUrModel & | getModel () const |
| |
|
|
static std::string | getSimObjectAspectTypeName () |
| |
|
static std::shared_ptr< BaseSimObjectAspect > | create (const nlohmann::json &jsonAspectProperties) |
| |
|
| enum | Buttons {
SWALLOW =PieceTypeID::SWALLOW
, STORMBIRD =PieceTypeID::STORMBIRD
, RAVEN =PieceTypeID::RAVEN
, ROOSTER =PieceTypeID::ROOSTER
,
EAGLE =PieceTypeID::EAGLE
, NEXT_TURN
, DICE
} |
| |
| enum class | Mode { INTERACT
, TRANSITION
} |
| |
|
|
void | onControllerReady () |
| |
|
void | updateText (const std::string &path, const std::string &text) |
| |
|
void | reactivateControls () |
| |
|
void | onButtonClicked (const std::string &button) |
| |
|
void | onPhaseUpdated (GamePhaseData phase) |
| |
|
void | onScoreUpdated (GameScoreData score) |
| |
|
void | onPlayerUpdated (PlayerData player) |
| |
|
void | onDiceUpdated (DiceData dice) |
| |
|
void | onViewUpdateStarted () |
| |
|
void | onMoveMade (MoveResultData moveData) |
| |
|
void | onControlInterface (PlayerID playerID) |
| |
|
bool | onCancel (const ToyMaker::ActionData &actionData, const ToyMaker::ActionDefinition &actionDefinition) |
| |
|
std::shared_ptr< ToyMaker::SimObject > | getLaunchButton (PieceTypeID pieceTypeID, PlayerID player) |
| |
|
std::shared_ptr< ToyMaker::SceneNode > | getPlayerPanel (PlayerID player) |
| |
|
std::shared_ptr< ToyMaker::SimObject > | getEndTurnButton () |
| |
|
|
std::weak_ptr< ToyMaker::SimObject > | mGameOfUrController {} |
| |
|
std::string | mControllerPath {} |
| |
|
PlayerID | mControlledBy {} |
| |
|
Mode | mMode { Mode::INTERACT } |
| |
|
std::vector< std::reference_wrapper< ToyMaker::UIText > > | mUpdatedTextElements {} |
| |
|
uint32_t | mAnimationTimeMillis { 0 } |
| |
|
uint32_t | mBlinkLengthMillis { 2500 } |
| |
|
uint32_t | mBlinkPeriodMillis { 400 } |
| |
| std::weak_ptr< ToyMaker::FixedActionBinding > | handleCancel |
| |
The aspect class for the UI layer of the game scene.
Converts UI interactions into game actions sent to the active player controller. Partially displays information about the current state of the game, as reported by the game data model or UrController.
◆ handleCancel
| std::weak_ptr<ToyMaker::FixedActionBinding> UrUIView::handleCancel |
|
private |
Initial value:{ declareFixedActionBinding(
"General", "Cancel", [this](const ToyMaker::ActionData& actionData, const ToyMaker::ActionDefinition& actionDefinition) {
return this->onCancel(actionData, actionDefinition);
}
)}
◆ kButtonEnumMap
| const std::map< std::string, UrUIView::Buttons > UrUIView::kButtonEnumMap |
|
staticprivate |
Initial value:{
{"swallow", UrUIView::Buttons::SWALLOW},
{"storm_bird", UrUIView::Buttons::STORMBIRD},
{"raven", UrUIView::Buttons::RAVEN},
{"rooster", UrUIView::Buttons::ROOSTER},
{"eagle", UrUIView::Buttons::EAGLE},
{"dice_roll", UrUIView::Buttons::DICE},
{"next_turn", UrUIView::Buttons::NEXT_TURN},
}
◆ mObserveButtonClicked
| ToyMaker::SignalObserver<const std::string&> UrUIView::mObserveButtonClicked |
Initial value:{
*this, "ButtonClickedObserved",
[this](const std::string& button) { this->onButtonClicked(button); }
}
◆ mObserveControlInterface
| ToyMaker::SignalObserver<PlayerID> UrUIView::mObserveControlInterface |
Initial value:{
*this, "ControlInterfaceObserved",
[
this](
PlayerID playerID) { this->onControlInterface(playerID); }
}
PlayerID
The two players playing the game, as known to GameOfUrModel.
Definition model.hpp:40
◆ mObserveControllerReady
| ToyMaker::SignalObserver UrUIView::mObserveControllerReady |
Initial value:{
*this, "ControllerReadyObserved",
[this]() {this->onControllerReady();}
}
◆ mObserveDiceUpdated
| ToyMaker::SignalObserver<DiceData> UrUIView::mObserveDiceUpdated |
Initial value:{
*this, "DiceUpdatedObserved",
[
this](
DiceData diceData) { this->onDiceUpdated(diceData); }
}
Data returned by GameOfUrModel when queried for dice related information.
Definition model.hpp:192
◆ mObserveMoveMade
Initial value:{
*this, "MoveMadeObserved",
}
Data returned by the GameOfUrModel when making a move, or querying possible moves.
Definition model.hpp:278
◆ mObservePhaseUpdated
| ToyMaker::SignalObserver<GamePhaseData> UrUIView::mObservePhaseUpdated |
Initial value:{
*this, "PhaseUpdatedObserved",
[
this](
GamePhaseData phaseData) { this->onPhaseUpdated(phaseData); }
}
Data returned by GameOfUrModel when queried about the current phase of the game.
Definition model.hpp:112
◆ mObservePlayerUpdated
| ToyMaker::SignalObserver<PlayerData> UrUIView::mObservePlayerUpdated |
Initial value:{
*this, "PlayerUpdatedObserved",
[
this](
PlayerData playerData) { this->onPlayerUpdated(playerData); }
}
Data returned by GameOfUrModel when queried about a player.
Definition model.hpp:229
◆ mObserveScoreUpdated
| ToyMaker::SignalObserver<GameScoreData> UrUIView::mObserveScoreUpdated |
Initial value:{
*this, "ScoreUpdatedObserved",
[
this](
GameScoreData scoreData) { this->onScoreUpdated(scoreData); }
}
Data returned by GameOfUrModel when queried for scores.
Definition model.hpp:151
◆ mObserveViewUpdateStarted
| ToyMaker::SignalObserver UrUIView::mObserveViewUpdateStarted |
Initial value:{
*this, "ViewUpdateStartedObserved",
[this](){ this->onViewUpdateStarted(); }
}
◆ mSigViewUpdateCompleted
| ToyMaker::Signal<std::string> UrUIView::mSigViewUpdateCompleted |
Initial value:{
*this, "ViewUpdateCompleted"
}
The documentation for this class was generated from the following files: