33#pragma region static_functions
45#pragma region overriden_functions
49 return std::make_unique<Deck>(*
this);
55 auto onUpdate(
float dt) ->
void override;
62 auto save(
Stream& stream)
const ->
void override;
70#pragma region Deck_functions
80 auto
size() const ->
int;
84#pragma region messaging_functions
88#pragma region member_variables
90 std::vector<std::unique_ptr<Card>>
deck;
95#pragma region helper_functions
101 auto cloneDeck(
const std::vector<std::unique_ptr<Card>>& otherDeck) -> void;
105#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
Component that represents a deck of playing cards.
Definition Deck.h:31
auto remakeDeck() -> void
Refills the deck with the standard 52 cards.
Definition Deck.cpp:106
friend auto from_json(const json &j, Deck &d) -> void
Definition Deck.cpp:73
auto isEmpty() const -> bool
Definition Deck.cpp:81
auto componentShowMenu() -> void override
Definition Deck.h:52
auto drawCardFromDeck() -> std::unique_ptr< Card >
Definition Deck.cpp:98
std::vector< std::unique_ptr< Card > > deck
Definition Deck.h:90
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Deck.h:57
auto size() const -> int
Definition Deck.cpp:119
Deck()
Definition Deck.cpp:29
Deck(Deck &&other) noexcept=default
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Deck.h:47
auto operator=(const Deck &) -> Deck &=default
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Deck.cpp:52
auto load(Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Deck.cpp:56
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Deck.cpp:61
auto onUpdate(float dt) -> void override
called once every frame.
Definition Deck.cpp:47
auto operator=(Deck &&other) noexcept -> Deck &=default
friend auto to_json(json &j, const Deck &d) -> void
Definition Deck.cpp:66
auto shuffleDeck() -> void
Definition Deck.cpp:90
auto cloneDeck(const std::vector< std::unique_ptr< Card > > &otherDeck) -> void
Duplicates all the elements in another deck into this one.
Definition Deck.cpp:124
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23