Rework for C Interfaces to handle exceptions a bit better.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,16 +10,18 @@ namespace CreatureLib::Battling {
|
||||
uint8_t _creature;
|
||||
|
||||
public:
|
||||
CreatureIndex() : _side(0), _creature(0) {}
|
||||
CreatureIndex(uint8_t side, uint8_t creature) : _side(side), _creature(creature) {}
|
||||
CreatureIndex() noexcept : _side(0), _creature(0) {}
|
||||
CreatureIndex(uint8_t side, uint8_t creature) noexcept : _side(side), _creature(creature) {}
|
||||
|
||||
uint8_t GetSideIndex() const { return _side; }
|
||||
uint8_t GetSideIndex() const noexcept { return _side; }
|
||||
|
||||
uint8_t GetCreatureIndex() const { return _creature; }
|
||||
uint8_t GetCreatureIndex() const noexcept { return _creature; }
|
||||
|
||||
bool operator==(const CreatureIndex& rhs) const { return (_side == rhs._side) && (_creature == rhs._creature); }
|
||||
bool operator==(const CreatureIndex& rhs) const noexcept {
|
||||
return (_side == rhs._side) && (_creature == rhs._creature);
|
||||
}
|
||||
|
||||
bool operator!=(const CreatureIndex& rhs) const { return !operator==(rhs); }
|
||||
bool operator!=(const CreatureIndex& rhs) const noexcept { return !operator==(rhs); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user