From 1a246f57e813ce8e1edade457501dbd6d1397ac6 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 2 Jan 2020 18:38:56 +0100 Subject: [PATCH] Make Creature class variables mostly protected instead of private. --- src/Battling/Models/Creature.hpp | 4 +++- src/GenericTemplates.hpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Battling/Models/Creature.hpp b/src/Battling/Models/Creature.hpp index 95e50cc..23762b7 100644 --- a/src/Battling/Models/Creature.hpp +++ b/src/Battling/Models/Creature.hpp @@ -17,6 +17,7 @@ namespace CreatureLib::Battling { class BattleLibrary; class Creature : public ScriptSource { + protected: const BattleLibrary* _library; GetProperty(const Library::CreatureSpecies*, Species); @@ -30,7 +31,7 @@ namespace CreatureLib::Battling { GetProperty(const Library::Item*, HeldItem); GetProperty(uint32_t, CurrentHealth); - private: + protected: Core::StatisticSet _statBoost; Core::StatisticSet _flatStats; Core::StatisticSet _boostedStats; @@ -52,6 +53,7 @@ namespace CreatureLib::Battling { Script* _status = nullptr; ScriptSet _volatile = {}; + private void OnFaint(); public: diff --git a/src/GenericTemplates.hpp b/src/GenericTemplates.hpp index bbd7be8..ba13e54 100644 --- a/src/GenericTemplates.hpp +++ b/src/GenericTemplates.hpp @@ -2,7 +2,7 @@ \brief GetProperty creates a simple wrapper for a field, creating a private field, and a public getter method. */ #define GetProperty(type, name) \ -private: \ +protected: \ type __##name; \ \ public: \