33#pragma region static_functions
49#pragma region overriden_functions
53 return std::make_unique<Deck>(*
this);
59 auto onUpdate(
float dt) ->
void override;
65 auto load(
const Stream& stream) ->
void override;
66 auto save(
Stream& stream)
const ->
void override;
74#pragma region Deck_functions
76 auto size() const ->
int;
95#pragma region messaging_functions
99#pragma region member_variables
108 std::vector<std::unique_ptr<Card>>
deck;
113#pragma region helper_functions
119 auto cloneDeck(
const std::vector<std::unique_ptr<Card>>& otherDeck) -> void;
123#pragma region static_variables
sys::Json Stream
Definition AudioObject.h:20
cardSuit
Definition Card.h:25
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
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
Resets the deck to the standard 52 cards.
Definition Deck.cpp:153
friend auto from_json(const json &j, Deck &d) -> void
Definition Deck.cpp:95
auto isEmpty() const -> bool
Definition Deck.cpp:109
auto componentShowMenu() -> void override
Definition Deck.h:56
static auto getEnum() -> ComponentTypeEnum
Definition Deck.h:35
auto drawCardFromDeck() -> std::unique_ptr< Card >
Definition Deck.cpp:129
std::vector< std::unique_ptr< Card > > deck
The actual storage of the cards that exist inside a deck.
Definition Deck.h:108
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Deck.h:61
auto drawSetFromDeck(int numberOfCards) -> std::vector< std::unique_ptr< Card > >
Draws multiple cards from the deck.
Definition Deck.cpp:137
auto size() const -> int
Definition Deck.cpp:103
Deck()
Definition Deck.cpp:46
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:51
static auto bindLuaTypes(sol::state &lua) -> void
Definition Deck.cpp:33
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Deck.cpp:74
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Deck.cpp:83
auto onUpdate(float dt) -> void override
called once every frame.
Definition Deck.cpp:69
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Deck.cpp:78
auto operator=(const Deck &) -> Deck &
Definition Deck.cpp:58
auto operator=(Deck &&other) noexcept -> Deck &=default
friend auto to_json(json &j, const Deck &d) -> void
Definition Deck.cpp:88
auto shuffleDeck() -> void
Definition Deck.cpp:118
auto cloneDeck(const std::vector< std::unique_ptr< Card > > &otherDeck) -> void
Duplicates all the elements in another deck into this one.
Definition Deck.cpp:166
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24