35class UrSceneView:
public ToyMaker::SimObjectAspect<UrSceneView> {
37 UrSceneView(): ToyMaker::SimObjectAspect<UrSceneView>{0} {}
39 inline static std::string getSimObjectAspectTypeName() {
return "UrSceneView"; }
40 static std::shared_ptr<BaseSimObjectAspect> create(
const nlohmann::json& jsonAspectProperties);
41 std::shared_ptr<BaseSimObjectAspect> clone()
const override;
49 LAUNCH_POSITION_SELECTION,
53 std::map<PieceIdentity, std::string> mPieceModelMap {};
54 std::map<PieceIdentity, std::shared_ptr<ToyMaker::SceneNode>> mPieceNodeMap {};
55 std::weak_ptr<ToyMaker::SimObject> mGameOfUrController {};
56 std::weak_ptr<ToyMaker::SimObject> mGameOfUrBoard {};
57 std::priority_queue<UrPieceAnimationKey> mAnimationKeys {};
58 uint32_t mAnimationTimeMillis {};
60 std::string mControllerPath {};
61 Mode mMode { Mode::GENERAL };
64 void onControllerReady();
66 void onBoardClicked(glm::u8vec2 boardLocation);
68 void onLaunchPieceCanceled();
71 void onViewUpdateStarted();
72 void onControlInterface(
PlayerID player);
74 void onActivated()
override;
75 void variableUpdate(uint32_t variableStepMillis)
override;
78 ToyMaker::SignalObserver<glm::u8vec2> mObserveBoardClicked {
79 *
this,
"BoardClickedObserved",
80 [
this](glm::u8vec2 boardLocation) { this->onBoardClicked(boardLocation); }
82 ToyMaker::SignalObserver<PieceTypeID> mObserveLaunchPieceInitiated {
83 *
this,
"LaunchPieceInitiatedObserved",
84 [
this](
PieceTypeID pieceType) { this->onLaunchPieceInitiated(pieceType); }
86 ToyMaker::SignalObserver<> mObserveLaunchPieceCancelled {
87 *
this,
"LaunchPieceCanceledObserved",
88 [
this]() { this->onLaunchPieceCanceled(); }
90 ToyMaker::SignalObserver<MoveResultData> mObserveMoveMade {
91 *
this,
"MoveMadeObserved",
92 [
this](
const MoveResultData& moveResultData) { this->onMoveMade(moveResultData); }
94 ToyMaker::SignalObserver<PlayerID> mObserveControlInterface {
95 *
this,
"ControlInterfaceObserved",
96 [
this](
PlayerID playerID) { this->onControlInterface(playerID); }
99 ToyMaker::Signal<PieceTypeID, glm::u8vec2> mSigLaunchPieceAttempted {
100 *
this,
"LaunchPieceAttempted"
102 ToyMaker::Signal<PieceIdentity> mSigMovePieceAttempted {
103 *
this,
"MovePieceAttempted"
106 ToyMaker::SignalObserver<> mObserveControllerReady {
107 *
this,
"ControllerReadyObserved",
108 [
this]() {this->onControllerReady();}
110 ToyMaker::Signal<std::string> mSigViewSubscribed {*
this,
"ViewSubscribed"};
112 ToyMaker::SignalObserver<> mObserveViewUpdateStarted {
113 *
this,
"ViewUpdateStartedObserved",
114 [
this](){ this->onViewUpdateStarted(); }
116 ToyMaker::Signal<std::string> mSigViewUpdateCompleted {
117 *
this,
"ViewUpdateCompleted"