From cdaa056810c68d4472e5e16687d8c5bd7d7960c5 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 23 Oct 2019 18:57:50 +0200 Subject: [PATCH] Initial support for learned moves --- src/Battling/Models/BattleCreature.hpp | 2 +- src/Library/{ => Living}/CreateCreature.cpp | 0 src/Library/{ => Living}/CreateCreature.hpp | 2 +- src/Library/{ => Living}/Creature.cpp | 0 src/Library/{ => Living}/Creature.hpp | 8 ++++---- src/Library/Living/LearnedAttack.cpp | 7 +++++++ src/Library/Living/LearnedAttack.hpp | 17 +++++++++++++++++ tests/LibraryTests/CreatureTests.cpp | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) rename src/Library/{ => Living}/CreateCreature.cpp (100%) rename src/Library/{ => Living}/CreateCreature.hpp (98%) rename src/Library/{ => Living}/Creature.cpp (100%) rename src/Library/{ => Living}/Creature.hpp (92%) create mode 100644 src/Library/Living/LearnedAttack.cpp create mode 100644 src/Library/Living/LearnedAttack.hpp diff --git a/src/Battling/Models/BattleCreature.hpp b/src/Battling/Models/BattleCreature.hpp index d4eb733..63e4b7d 100644 --- a/src/Battling/Models/BattleCreature.hpp +++ b/src/Battling/Models/BattleCreature.hpp @@ -2,7 +2,7 @@ #define CREATURELIB_BATTLECREATURE_HPP #include "../../GenericTemplates.cpp" -#include "../../Library/Creature.hpp" +#include "../../Library/Living/Creature.hpp" namespace CreatureLib::Battling{ // Forward declare battle class diff --git a/src/Library/CreateCreature.cpp b/src/Library/Living/CreateCreature.cpp similarity index 100% rename from src/Library/CreateCreature.cpp rename to src/Library/Living/CreateCreature.cpp diff --git a/src/Library/CreateCreature.hpp b/src/Library/Living/CreateCreature.hpp similarity index 98% rename from src/Library/CreateCreature.hpp rename to src/Library/Living/CreateCreature.hpp index a8e69c7..12a9fc7 100644 --- a/src/Library/CreateCreature.hpp +++ b/src/Library/Living/CreateCreature.hpp @@ -2,7 +2,7 @@ #define CREATURELIB_CREATECREATURE_HPP -#include "DataLibrary.hpp" +#include "../DataLibrary.hpp" #include "Creature.hpp" namespace CreatureLib::Library { diff --git a/src/Library/Creature.cpp b/src/Library/Living/Creature.cpp similarity index 100% rename from src/Library/Creature.cpp rename to src/Library/Living/Creature.cpp diff --git a/src/Library/Creature.hpp b/src/Library/Living/Creature.hpp similarity index 92% rename from src/Library/Creature.hpp rename to src/Library/Living/Creature.hpp index a49fb76..ef4102a 100644 --- a/src/Library/Creature.hpp +++ b/src/Library/Living/Creature.hpp @@ -1,10 +1,10 @@ #ifndef CREATURELIB_CREATURE_HPP #define CREATURELIB_CREATURE_HPP -#include "DataLibrary.hpp" -#include "Gender.hpp" -#include "../GenericTemplates.cpp" -#include "../Core/StatisticSet.hpp" +#include "../DataLibrary.hpp" +#include "../Gender.hpp" +#include "../../GenericTemplates.cpp" +#include "../../Core/StatisticSet.hpp" namespace CreatureLib::Library{ class Creature { diff --git a/src/Library/Living/LearnedAttack.cpp b/src/Library/Living/LearnedAttack.cpp new file mode 100644 index 0000000..7893377 --- /dev/null +++ b/src/Library/Living/LearnedAttack.cpp @@ -0,0 +1,7 @@ +#include "LearnedAttack.hpp" + +CreatureLib::Library::LearnedAttack::LearnedAttack(CreatureLib::Library::AttackData *attack, uint8_t maxUses) + :_attack(attack), _maxUses(maxUses), _remainingUses(maxUses) +{ + +} diff --git a/src/Library/Living/LearnedAttack.hpp b/src/Library/Living/LearnedAttack.hpp new file mode 100644 index 0000000..aa78224 --- /dev/null +++ b/src/Library/Living/LearnedAttack.hpp @@ -0,0 +1,17 @@ +#ifndef CREATURELIB_LEARNEDATTACK_HPP +#define CREATURELIB_LEARNEDATTACK_HPP + +#include "../Attacks/AttackData.hpp" + +namespace CreatureLib::Library{ + class LearnedAttack { + const AttackData* _attack; + const uint8_t _maxUses; + const uint8_t _remainingUses; + public: + LearnedAttack(AttackData* attack, uint8_t maxUses); + }; +} + + +#endif //CREATURELIB_LEARNEDATTACK_HPP diff --git a/tests/LibraryTests/CreatureTests.cpp b/tests/LibraryTests/CreatureTests.cpp index 38ba070..4c83662 100644 --- a/tests/LibraryTests/CreatureTests.cpp +++ b/tests/LibraryTests/CreatureTests.cpp @@ -1,5 +1,5 @@ #ifdef TESTS_BUILD -#include "../../src/Library/CreateCreature.hpp" +#include "../../src/Library/Living/CreateCreature.hpp" #include "../TestLibrary/TestLibrary.cpp" using namespace CreatureLib::Library;