Support for suppressing a script, so that it temporarily does not function.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -17,12 +17,16 @@ namespace CreatureLib::Battling {
|
||||
|
||||
class BattleScript {
|
||||
ArbUt::OptionalBorrowedPtr<void> _owner;
|
||||
size_t _suppressed = 0;
|
||||
|
||||
public:
|
||||
BattleScript(const ArbUt::OptionalBorrowedPtr<void>& owner) { _owner = owner; };
|
||||
NO_COPY_OR_MOVE(BattleScript);
|
||||
|
||||
inline ArbUt::OptionalBorrowedPtr<void> GetOwner() const noexcept { return _owner; }
|
||||
inline bool IsSuppressed() const noexcept { return _suppressed > 0; }
|
||||
inline void Suppress() { _suppressed++; }
|
||||
inline void Unsuppress() { _suppressed--; }
|
||||
|
||||
virtual ~BattleScript() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user