Files
CreatureLib/src/Battling/TurnChoices/SwitchTurnChoice.hpp
Deukhoofd 5c39694f19
Some checks failed
continuous-integration/drone/push Build is failing
Overhaul memory model to new Arbutils memory.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-12-12 12:22:48 +01:00

24 lines
931 B
C++

#ifndef CREATURELIB_SWITCHTURNCHOICE_HPP
#define CREATURELIB_SWITCHTURNCHOICE_HPP
#include "BaseTurnChoice.hpp"
namespace CreatureLib::Battling {
class SwitchTurnChoice : public BaseTurnChoice {
ArbUt::OptionalBorrowedPtr<Creature> _newCreature;
public:
SwitchTurnChoice(ArbUt::BorrowedPtr<Creature> user, ArbUt::OptionalBorrowedPtr<Creature> newCreature) noexcept
: BaseTurnChoice(user), _newCreature(newCreature) {}
TurnChoiceKind GetKind() const noexcept final { return TurnChoiceKind::Switch; }
inline const ArbUt::OptionalBorrowedPtr<Creature>& GetNewCreature() const noexcept { return _newCreature; }
size_t ScriptCount() const override { return GetUser()->ScriptCount(); }
protected:
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override { GetUser()->GetActiveScripts(scripts); }
};
}
#endif // CREATURELIB_SWITCHTURNCHOICE_HPP