Brunot
Loading...
Searching...
No Matches
NewComponentStub.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19#pragma once
20#include "Framework/Component.h"
21
23{
24public:
25#pragma region static_functions
26 static auto bindLuaTypes(sol::state& lua) -> void {}
27 static auto getEnum() -> ComponentTypeEnum
28 {
29 return cNewComponentStub;
30 }
31
32#pragma endregion
33
36 auto operator=(const NewComponentStub&) -> NewComponentStub& = default;
37 ~NewComponentStub() override = default;
38 NewComponentStub(NewComponentStub&& other) noexcept;
39 auto operator=(NewComponentStub&& other) noexcept -> NewComponentStub& = default;
40
41#pragma region overriden_functions
42
43 auto clone() const -> std::unique_ptr<GameObject> override
44 {
45 return std::make_unique<NewComponentStub>(*this);
46 }
47
48 /* Only override componentShowMenu if you have something to display
49 auto componentShowMenu() -> void override
50 {
51 } // for debug ImGUI
52 */
53 auto onUpdate(float dt) -> void override;
54
55 auto endWindow() -> void override
56 {
57 } // for debug ImGUI
58 auto onRender() -> void override;
59 auto load(const Stream& stream) -> void override;
60 auto save(Stream& stream) const -> void override;
61
62 friend auto to_json(json& j, const NewComponentStub& n) -> void;
63 friend auto from_json(const json& j, NewComponentStub& n) -> void;
64
65
66#pragma endregion
67
68#pragma region newComponentStub_functions
69
70#pragma endregion
71
72#pragma region messaging_functions
73 auto linkMessages() -> void;
74
75#pragma endregion
76
77private:
78#pragma region member_variables
79
80#pragma endregion
81
82#pragma region helper_functions
83
84#pragma endregion
85
86#pragma region static_variables
87
88#pragma endregion
89
90};
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
ComponentTypeEnum
This enum lists out every type of component we have.
Definition Component.h:39
@ cNewComponentStub
Definition Component.h:45
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
Definition NewComponentStub.h:23
auto onUpdate(float dt) -> void override
called once every frame.
Definition NewComponentStub.cpp:44
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition NewComponentStub.cpp:58
auto operator=(const NewComponentStub &) -> NewComponentStub &=default
auto linkMessages() -> void
Definition NewComponentStub.cpp:78
NewComponentStub()
Definition NewComponentStub.cpp:23
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition NewComponentStub.cpp:53
static auto bindLuaTypes(sol::state &lua) -> void
Definition NewComponentStub.h:26
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition NewComponentStub.h:55
static auto getEnum() -> ComponentTypeEnum
Definition NewComponentStub.h:27
friend auto from_json(const json &j, NewComponentStub &n) -> void
Definition NewComponentStub.cpp:70
auto onRender() -> void override
called every frame after update has been called for every object.
Definition NewComponentStub.cpp:49
~NewComponentStub() override=default
auto operator=(NewComponentStub &&other) noexcept -> NewComponentStub &=default
friend auto to_json(json &j, const NewComponentStub &n) -> void
Definition NewComponentStub.cpp:63
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition NewComponentStub.h:43