Brunot
Loading...
Searching...
No Matches
Background.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19
20// File: Background.h
21// Description: The component that holds the texture behind everything
22// Author(s): Bryley Elder (bryley.elder@digipen.edu)
23// 2025 / 11 / 21
24// (C) Digipen 202
25// ____ __ __ __
26// /\__ _\/\ \ /\ \/\ \
27// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
28// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
29// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
30// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
31// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
32
33#pragma once
34#include "Framework/Component.h"
35
40class Background : public Component
41{
42public:
43 static auto getEnum() -> ComponentTypeEnum
44 {
45 return cBackground;
46 }
47 static auto bindLuaTypes(sol::state& lua) -> void {}
48 Background();
49 Background(const Background&) = default;
50 auto operator=(const Background&) -> Background& = default;
51 ~Background() override = default;
52 Background(Background&& other) noexcept = default;
53 auto operator=(Background&& other) noexcept -> Background& = default;
54
55 auto clone() const -> std::unique_ptr<GameObject> override;
56
57 auto componentShowMenu() -> void override
58 {
59 } // for debug ImGUI
60 auto onUpdate(float dt) -> void override;
61
62 auto endWindow() -> void override
63 {
64 }; // for debug ImGUI
65 auto onRender() -> void override;
66 auto load(const Stream& stream) -> void override;
67 auto save(Stream& stream) const -> void override;
68
69 friend auto to_json(json& j, const Background& p) -> void;
70 friend auto from_json(const json& j, Background& p) -> void;
71
72};
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
The component that holds the texture behind everything.
Definition Background.h:41
Background()
Definition Background.cpp:38
friend auto from_json(const json &j, Background &p) -> void
Definition Background.cpp:83
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Background.cpp:43
static auto getEnum() -> ComponentTypeEnum
Definition Background.h:43
Background(const Background &)=default
friend auto to_json(json &j, const Background &p) -> void
Definition Background.cpp:76
auto operator=(const Background &) -> Background &=default
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Background.h:62
static auto bindLuaTypes(sol::state &lua) -> void
Definition Background.h:47
Background(Background &&other) noexcept=default
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Background.cpp:66
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Background.cpp:71
~Background() override=default
auto onUpdate(float dt) -> void override
called once every frame.
Definition Background.cpp:48
auto componentShowMenu() -> void override
Definition Background.h:57
auto operator=(Background &&other) noexcept -> Background &=default
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Background.cpp:62
ComponentTypeEnum
This enum lists out every type of component we have.
Definition Component.h:39
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