From 92d0f35b989b0164e2dd8c9a32213c6038e5d57f Mon Sep 17 00:00:00 2001 From: ClarkeCode Date: Fri, 28 Apr 2023 13:22:47 -0400 Subject: Struct tweaks --- extension/src/openvic2/Good.cpp | 18 +----------------- extension/src/openvic2/Good.hpp | 20 +++++++++----------- 2 files changed, 10 insertions(+), 28 deletions(-) (limited to 'extension/src/openvic2') 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 -#include +#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 +} -- cgit v1.2.3-56-ga3b1