33#pragma region static_functions
45#pragma region overriden_functions
49 return std::make_unique<Selector>(*
this);
53 auto onUpdate(
float dt) ->
void override;
60 auto save(
Stream& stream)
const ->
void override;
68#pragma region Selector_functions
77#pragma region messaging_functions
100#pragma region member_variables
108#pragma region helper_functions
112 virtual auto select() -> void;
119#pragma region static_variables
sys::Json Stream
Definition AudioObject.h:20
The base class for components, holding all of their shared All components should inherit from this.
nlohmann::json json
Definition Json.cpp:19
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
friend Entity
Definition GameObject.h:84
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
An indicator that loops through a parents' nodes children and can "select" them on keypress.
Definition Selector.h:31
friend auto from_json(const json &j, Selector &s) -> void
Definition Selector.cpp:118
auto moveRight(Menu *menu) -> void
Helper function that actually moves the selector right in a menu.
Definition Selector.cpp:170
auto receiveRightKeyPressed(const Message *message) -> Message
Definition Selector.cpp:230
bool enabled
If the selector is disabled, it does not move around or select.
Definition Selector.h:103
auto moveToNewParent(Entity *newParent) -> void
Definition Selector.cpp:130
auto moveDown(Menu *menu) -> void
Helper function that actually moves the selector down in a menu.
Definition Selector.cpp:154
auto load(Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Selector.cpp:100
auto linkMessages() -> void
Definition Selector.cpp:189
~Selector() override=default
virtual auto select() -> void
Selects the button that the selector is hovering over.
Definition Selector.cpp:179
auto operator=(Selector &&other) noexcept -> Selector &=default
auto receiveLeftKeyPressed(const Message *message) -> Message
Definition Selector.cpp:220
Selector()
Definition Selector.cpp:39
auto operator=(const Selector &) -> Selector &=default
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Selector.cpp:105
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Selector.cpp:76
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Selector.h:55
auto componentShowMenu() -> void override
Definition Selector.cpp:63
auto receiveDownKeyPressed(const Message *message) -> Message
Definition Selector.cpp:250
auto receiveUpKeyPressed(const Message *message) -> Message
Definition Selector.cpp:240
friend auto to_json(json &j, const Selector &s) -> void
Definition Selector.cpp:110
auto moveLeft(Menu *menu) -> void
Helper function that actually moves the selector left in a menu.
Definition Selector.cpp:162
auto moveUp(Menu *menu) -> void
Helper function that actually moves the selector up in a menu.
Definition Selector.cpp:146
auto receiveSelectKeyPressed(const Message *message) -> Message
Definition Selector.cpp:260
auto onUpdate(float dt) -> void override
called once every frame.
Definition Selector.cpp:70
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Selector.h:47
auto setEnabled(bool state) -> void
Definition Selector.h:70