Renamed Target class to CreatureIndex

This commit is contained in:
2019-12-05 09:53:48 +01:00
parent a8730d983f
commit 5d6ac316eb
4 changed files with 20 additions and 20 deletions

View File

@@ -6,7 +6,7 @@
#include "../Library/BattleLibrary.hpp"
#include "../TurnChoices/BaseTurnChoice.hpp"
#include "BattleSide.hpp"
#include "Target.hpp"
#include "CreatureIndex.hpp"
namespace CreatureLib::Battling {
class Battle : public ScriptSource {
@@ -33,7 +33,7 @@ namespace CreatureLib::Battling {
bool CreatureInField(const Creature* creature) const;
Creature* GetTarget(const Target& target) {
Creature* GetTarget(const CreatureIndex& target) {
return _sides[target.GetSideIndex()]->GetCreature(target.GetCreatureIndex());
}

View File

@@ -1,16 +1,16 @@
#ifndef CREATURELIB_TARGET_HPP
#define CREATURELIB_TARGET_HPP
#ifndef CREATURELIB_CREATUREINDEX_HPP
#define CREATURELIB_CREATUREINDEX_HPP
#include <cstdint>
#include "Creature.hpp"
namespace CreatureLib::Battling {
class Target {
class CreatureIndex {
uint8_t _side;
uint8_t _creature;
public:
Target(uint8_t side, uint8_t creature) : _side(side), _creature(creature) {}
CreatureIndex(uint8_t side, uint8_t creature) : _side(side), _creature(creature) {}
uint8_t GetSideIndex() const { return _side; }
@@ -18,4 +18,4 @@ namespace CreatureLib::Battling {
};
}
#endif // CREATURELIB_TARGET_HPP
#endif // CREATURELIB_CREATUREINDEX_HPP