Rework for C Interfaces to handle exceptions a bit better.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-25 19:07:36 +01:00
parent 27288563cd
commit 7ce3e6940d
53 changed files with 7526 additions and 8340 deletions

View File

@@ -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); }
};
}