CreatureLib/src/Battling/Models/CreatureIndex.hpp

27 lines
810 B
C++
Raw Normal View History

2019-12-05 08:53:48 +00:00
#ifndef CREATURELIB_CREATUREINDEX_HPP
#define CREATURELIB_CREATUREINDEX_HPP
#include "../../Defines.hpp"
2019-11-02 12:57:43 +00:00
namespace CreatureLib::Battling {
2019-12-05 08:53:48 +00:00
class CreatureIndex {
u8 _side;
u8 _creature;
2019-11-02 12:57:43 +00:00
public:
CreatureIndex() noexcept : _side(0), _creature(0) {}
CreatureIndex(uint8_t side, u8 creature) noexcept : _side(side), _creature(creature) {}
2019-11-02 12:57:43 +00:00
uint8_t GetSideIndex() const noexcept { return _side; }
2019-11-02 12:57:43 +00:00
uint8_t GetCreatureIndex() const noexcept { return _creature; }
bool operator==(const CreatureIndex& rhs) const noexcept {
return (_side == rhs._side) && (_creature == rhs._creature);
}
bool operator!=(const CreatureIndex& rhs) const noexcept { return !operator==(rhs); }
2019-11-02 12:57:43 +00:00
};
}
2019-12-05 08:53:48 +00:00
#endif // CREATURELIB_CREATUREINDEX_HPP