25 lines
967 B
C++
25 lines
967 B
C++
#ifndef CREATURELIB_BATTLERESULT_HPP
|
|
#define CREATURELIB_BATTLERESULT_HPP
|
|
|
|
namespace CreatureLib::Battling {
|
|
class BattleResult {
|
|
bool _conclusiveResult;
|
|
u8 _winningSide;
|
|
|
|
BattleResult(bool conclusiveResult, u8 winningSide)
|
|
: _conclusiveResult(conclusiveResult), _winningSide(winningSide) {}
|
|
|
|
public:
|
|
static BattleResult Inconclusive() { return BattleResult(false, 0); }
|
|
static BattleResult Conclusive(u8 winner) { return BattleResult(true, winner); }
|
|
static BattleResult Empty() { return BattleResult(false, 0); }
|
|
|
|
/// Whether or not the battle has ended with a conclusive result.
|
|
bool IsConclusiveResult() const noexcept { return _conclusiveResult; }
|
|
/// Get the index of the side that has won the battle. Only valid if the battle has a conclusive result.
|
|
u8 GetWinningSide() const noexcept { return _winningSide; }
|
|
};
|
|
}
|
|
|
|
#endif // CREATURELIB_BATTLERESULT_HPP
|