Simplify check whether mon is on battle field.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
44de4a0799
commit
f463ba8496
|
@ -31,7 +31,7 @@ void TurnHandler::ExecuteChoice(ArbUt::BorrowedPtr<BaseTurnChoice> choice) {
|
||||||
auto battle = user->GetBattle();
|
auto battle = user->GetBattle();
|
||||||
AssertNotNull(battle)
|
AssertNotNull(battle)
|
||||||
// If the user is not in the field, we don't want to execute its choice.
|
// If the user is not in the field, we don't want to execute its choice.
|
||||||
if (!battle->CreatureInField(user)) {
|
if (!user->IsOnBattleField()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// If the choice is not valid, we don't want to execute it.
|
// If the choice is not valid, we don't want to execute it.
|
||||||
|
|
|
@ -102,10 +102,10 @@ namespace CreatureLib::Battling {
|
||||||
void SetBattleData(ArbUt::BorrowedPtr<Battle> battle, ArbUt::BorrowedPtr<BattleSide> side);
|
void SetBattleData(ArbUt::BorrowedPtr<Battle> battle, ArbUt::BorrowedPtr<BattleSide> side);
|
||||||
const ArbUt::BorrowedPtr<Battle>& GetBattle() const;
|
const ArbUt::BorrowedPtr<Battle>& GetBattle() const;
|
||||||
const ArbUt::BorrowedPtr<BattleSide>& GetBattleSide() const;
|
const ArbUt::BorrowedPtr<BattleSide>& GetBattleSide() const;
|
||||||
void SetOnBattleField(bool value) { _onBattleField = value; }
|
inline void SetOnBattleField(bool value) { _onBattleField = value; }
|
||||||
bool IsOnBattleField() const { return _onBattleField; }
|
inline bool IsOnBattleField() const { return _onBattleField; }
|
||||||
|
|
||||||
const std::string& GetNickname() const noexcept { return _nickname; }
|
inline const std::string& GetNickname() const noexcept { return _nickname; }
|
||||||
const ArbUt::CaseInsensitiveConstString& GetActiveTalent() const;
|
const ArbUt::CaseInsensitiveConstString& GetActiveTalent() const;
|
||||||
|
|
||||||
[[nodiscard]] bool IsFainted() const noexcept;
|
[[nodiscard]] bool IsFainted() const noexcept;
|
||||||
|
|
Loading…
Reference in New Issue