diff options
author | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-28 19:22:47 +0200 |
---|---|---|
committer | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-28 19:22:47 +0200 |
commit | 92d0f35b989b0164e2dd8c9a32213c6038e5d57f (patch) | |
tree | c7218b23a831ac9fd7421a4256699b52cdedf242 | |
parent | b6f9d6433c4ace514fa991cea628c2598c3bc65c (diff) |
Struct tweaks
-rw-r--r-- | extension/src/openvic2/Good.cpp | 18 | ||||
-rw-r--r-- | extension/src/openvic2/Good.hpp | 20 |
2 files changed, 10 insertions, 28 deletions
diff --git a/extension/src/openvic2/Good.cpp b/extension/src/openvic2/Good.cpp index ecd2bfb..e3389de 100644 --- a/extension/src/openvic2/Good.cpp +++ b/extension/src/openvic2/Good.cpp @@ -1,19 +1,3 @@ #include "Good.hpp" -using namespace OpenVic2;; - -Good::Good() = default; - -Good::Good(const godot::String& identifier, const godot::String& category, price_t cost, const godot::String& colour, - bool isAvailable, bool isTradable, bool isMoney, bool hasOverseasPenalty) { - this->identifier = identifier; - this->category = category; - this->cost = cost; - this->colour = colour; - this->isAvailableAtStart = isAvailable; - this->isTradable = isTradable; - this->isMoney = isMoney; - this->hasOverseasPenalty = hasOverseasPenalty; -} - -Good::~Good() = default;
\ No newline at end of file +using namespace OpenVic2; diff --git a/extension/src/openvic2/Good.hpp b/extension/src/openvic2/Good.hpp index dd2e8a8..7953c51 100644 --- a/extension/src/openvic2/Good.hpp +++ b/extension/src/openvic2/Good.hpp @@ -1,25 +1,23 @@ #pragma once #include <string> -#include <godot_cpp/variant/string.hpp> +#include "Types.hpp" namespace OpenVic2 { - class Good { + class Good : HasIdentifier { public: using price_t = float; - godot::String identifier; - godot::String category; + std::string category; price_t cost; - godot::String colour; - bool isAvailableAtStart; + std::string colour; + bool isAvailable; bool isTradable; bool isMoney; bool hasOverseasPenalty; - Good(); - Good(const godot::String& identifier, const godot::String& category, price_t cost, const godot::String& colour, - bool isAvailable, bool isTradable, bool isMoney, bool hasOverseasPenalty); - ~Good(); + Good(std::string const& identifier,std::string const& category, price_t cost, std::string const& colour, + bool isAvailable, bool isTradable, bool isMoney, bool hasOverseasPenalty) : HasIdentifier(identifier), + category(category), cost(cost), colour(colour), isAvailable(isAvailable), isMoney(isMoney), hasOverseasPenalty(hasOverseasPenalty) {}; }; -}
\ No newline at end of file +} |