12#ifndef ZOAPPBOARDLOCATIONS_H
13#define ZOAPPBOARDLOCATIONS_H
15#include <toymaker/engine/sim_system.hpp>
16#include <toymaker/builtins/interface_pointer_callback.hpp>
24class BoardLocations:
public ToyMaker::SimObjectAspect<BoardLocations>,
public ToyMaker::ILeftClickable,
public ToyMaker::IHoverable {
49 static std::shared_ptr<BaseSimObjectAspect>
create(
const nlohmann::json& jsonAspectProperties);
56 std::shared_ptr<BaseSimObjectAspect>
clone()
const override;
static std::string getSimObjectAspectTypeName()
Gets the aspect type string associated with this class.
Definition board_locations.hpp:32
bool onPointerLeave() override
Responds to pointer leave events by reporting them to subscribed event observers.
Definition board_locations.cpp:35
std::shared_ptr< BaseSimObjectAspect > clone() const override
Uses this aspect's data to construct a new aspect.
Definition board_locations.cpp:44
bool onPointerLeftRelease(glm::vec4 clickLocation) override
Responds to a full left click by emitting mSigBoardClicked with the clicked location's equivalent gam...
Definition board_locations.hpp:130
ToyMaker::Signal< glm::u8vec2 > mSigBoardHovered
The event emitted signalling to the 3D viewport controller that a location on the board was hovered o...
Definition board_locations.hpp:69
ToyMaker::Signal< glm::u8vec2 > mSigBoardClicked
The event emitted signalling to the 3D viewport controller that a location on the board was clicked.
Definition board_locations.hpp:62
static std::shared_ptr< BaseSimObjectAspect > create(const nlohmann::json &jsonAspectProperties)
Constructs this aspect from its JSON description.
Definition board_locations.cpp:39
bool onPointerLeftClick(glm::vec4 clickLocation) override
Responds to left click events by logging them to the console, translating the location of the click t...
Definition board_locations.cpp:8
glm::uvec2 boardPointToGridIndices(glm::vec2 point) const
Given the 2D coordinates of a point relative to the top surface of the board, returns the equivalent ...
Definition board_locations.cpp:48
BoardLocations()
Constructs a new Board Locations object.
Definition board_locations.hpp:136
std::array< uint8_t, 3 > mRowLengths
The lengths of the 3 rows of the game board representing the number of valid houses on it.
Definition board_locations.hpp:142
bool onPointerEnter(glm::vec4 hoverLocation) override
Unused pointer hover callback.
Definition board_locations.hpp:101
bool onPointerHover(glm::vec4 hoverLocation) override
Responds to pointer enter events by reporting them to subscribed event observers.
Definition board_locations.cpp:21
glm::vec4 gridIndicesToBoardPoint(glm::u8vec2 gridIndices) const
Translates game board data model grid coordinates to their real world 3D coordinates equivalent.
Definition board_locations.cpp:63