Renamed Target class to CreatureIndex
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user