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;
47 static const glm::u8vec2 kGridUnfocused;
51 LAUNCH_POSITION_SELECTION,
55 std::map<PieceIdentity, std::string> mPieceModelMap {};
56 std::map<PieceIdentity, std::shared_ptr<ToyMaker::SceneNode>> mPieceNodeMap {};
57 std::weak_ptr<ToyMaker::SimObject> mGameOfUrController {};
58 std::weak_ptr<ToyMaker::SimObject> mGameOfUrBoard {};
59 std::priority_queue<UrPieceAnimationKey> mAnimationKeys {};
60 uint32_t mAnimationTimeMillis {};
62 std::string mControllerPath {};
63 Mode mMode { Mode::GENERAL };
65 glm::u8vec2 mFocusedGridCell {};
67 void onControllerReady();
69 void onBoardClicked(glm::u8vec2 boardLocation);
70 void onBoardHovered(glm::u8vec2 boardLocation);
73 void onLaunchPieceCanceled();
76 void onViewUpdateStarted();
77 void onControlInterface(
PlayerID player);
79 void onActivated()
override;
80 void variableUpdate(uint32_t variableStepMillis)
override;
82 void addLight(glm::u8vec2 boardPosition,
const ToyMaker::LightEmissionData& light);
83 void addLights(
const std::vector<glm::u8vec2>& boardPositions);
87 ToyMaker::SignalObserver<glm::u8vec2> mObserveBoardClicked {
88 *
this,
"BoardClickedObserved",
89 [
this](glm::u8vec2 boardLocation) { this->onBoardClicked(boardLocation); }
91 ToyMaker::SignalObserver<glm::u8vec2> mObserveBoardHovered {
92 *
this,
"BoardHoveredObserved",
93 [
this](glm::u8vec2 boardLocation) { this->onBoardHovered(boardLocation); }
95 ToyMaker::SignalObserver<PieceTypeID> mObserveLaunchPieceInitiated {
96 *
this,
"LaunchPieceInitiatedObserved",
97 [
this](
PieceTypeID pieceType) { this->onLaunchPieceInitiated(pieceType); }
99 ToyMaker::SignalObserver<PieceTypeID> mObserveLaunchPieceHovered {
100 *
this,
"LaunchPieceHoveredObserved",
101 [
this](
PieceTypeID pieceType) { this->onLaunchPieceHovered(pieceType); }
103 ToyMaker::SignalObserver<> mObserveLaunchPieceCancelled {
104 *
this,
"LaunchPieceCanceledObserved",
105 [
this]() { this->onLaunchPieceCanceled(); }
107 ToyMaker::SignalObserver<MoveResultData> mObserveMoveMade {
108 *
this,
"MoveMadeObserved",
109 [
this](
const MoveResultData& moveResultData) { this->onMoveMade(moveResultData); }
111 ToyMaker::SignalObserver<PlayerID> mObserveControlInterface {
112 *
this,
"ControlInterfaceObserved",
113 [
this](
PlayerID playerID) { this->onControlInterface(playerID); }
116 ToyMaker::Signal<PieceTypeID, glm::u8vec2> mSigLaunchPieceAttempted {
117 *
this,
"LaunchPieceAttempted"
119 ToyMaker::Signal<PieceIdentity> mSigMovePieceAttempted {
120 *
this,
"MovePieceAttempted"
123 ToyMaker::SignalObserver<> mObserveControllerReady {
124 *
this,
"ControllerReadyObserved",
125 [
this]() {this->onControllerReady();}
127 ToyMaker::Signal<std::string> mSigViewSubscribed {*
this,
"ViewSubscribed"};
129 ToyMaker::SignalObserver<> mObserveViewUpdateStarted {
130 *
this,
"ViewUpdateStartedObserved",
131 [
this](){ this->onViewUpdateStarted(); }
133 ToyMaker::Signal<std::string> mSigViewUpdateCompleted {
134 *
this,
"ViewUpdateCompleted"