Overhaul memory model to new Arbutils memory.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -22,9 +22,9 @@ namespace CreatureLib::Battling {
|
||||
if (user == nullptr)
|
||||
return;
|
||||
auto battle = user->GetBattle();
|
||||
if (battle != nullptr) {
|
||||
if (battle.HasValue()) {
|
||||
if (_attack->GetAttack()->HasSecondaryEffect()) {
|
||||
auto library = battle->GetLibrary();
|
||||
auto library = battle.GetValue()->GetLibrary();
|
||||
auto& effect = _attack->GetAttack()->GetSecondaryEffect();
|
||||
_attackScript =
|
||||
std::unique_ptr<Script>(library->LoadScript(ScriptCategory::Attack, effect->GetEffectName()));
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
#include "BaseTurnChoice.hpp"
|
||||
namespace CreatureLib::Battling {
|
||||
class SwitchTurnChoice : public BaseTurnChoice {
|
||||
ArbUt::BorrowedPtr<Creature> _newCreature;
|
||||
ArbUt::OptionalBorrowedPtr<Creature> _newCreature;
|
||||
|
||||
public:
|
||||
SwitchTurnChoice(ArbUt::BorrowedPtr<Creature> user, ArbUt::BorrowedPtr<Creature> newCreature) noexcept
|
||||
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::BorrowedPtr<Creature>& GetNewCreature() const noexcept { return _newCreature; }
|
||||
inline const ArbUt::OptionalBorrowedPtr<Creature>& GetNewCreature() const noexcept { return _newCreature; }
|
||||
size_t ScriptCount() const override { return GetUser()->ScriptCount(); }
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user