Update to latest Arbutils, use new integer defines
This commit is contained in:
@@ -49,8 +49,8 @@ namespace CreatureLib::Battling {
|
||||
_par_ const ArbUt::List<CreatureLib::Library::EffectParameter*>& parameters){};
|
||||
virtual void OnBeforeTurn(_par_ const BaseTurnChoice* choice){};
|
||||
|
||||
virtual void ChangeSpeed(_par_ BaseTurnChoice* choice, _par_ uint32_t* speed){};
|
||||
virtual void ChangePriority(_par_ AttackTurnChoice* choice, _par_ int8_t* priority){};
|
||||
virtual void ChangeSpeed(_par_ BaseTurnChoice* choice, _par_ u32* speed){};
|
||||
virtual void ChangePriority(_par_ AttackTurnChoice* choice, _par_ i8* priority){};
|
||||
virtual void ChangeAttack(_par_ AttackTurnChoice* choice, _par_ ArbUt::StringView* outAttack){};
|
||||
virtual void ModifyNumberOfHits(_par_ AttackTurnChoice* choice, _par_ u8* numberOfHits){};
|
||||
virtual void PreventAttack(_par_ ExecutingAttack* attack, _par_ bool* outResult){};
|
||||
@@ -90,10 +90,10 @@ namespace CreatureLib::Battling {
|
||||
virtual void OnFaintingOpponent(_par_ const ExecutingAttack* attack, _par_ Creature* target,
|
||||
_par_ u8 hitNumber){};
|
||||
|
||||
virtual void PreventStatBoostChange(_par_ Creature* target, _par_ Library::Statistic stat,
|
||||
_par_ int8_t diffAmount, _par_ bool selfInflicted, _par_ bool* prevent){};
|
||||
virtual void PreventStatBoostChange(_par_ Creature* target, _par_ Library::Statistic stat, _par_ i8 diffAmount,
|
||||
_par_ bool selfInflicted, _par_ bool* prevent){};
|
||||
virtual void ModifyStatBoostChange(_par_ Creature* target, _par_ Library::Statistic stat,
|
||||
_par_ int8_t* diffAmount){};
|
||||
_par_ i8* diffAmount){};
|
||||
virtual void PreventSecondaryEffects(_par_ const ExecutingAttack* attack, _par_ Creature* target,
|
||||
_par_ u8 hitNumber, _par_ bool* outResult){};
|
||||
virtual void OnSecondaryEffect(_par_ const ExecutingAttack* attack, _par_ Creature* target,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class ScriptAggregator {
|
||||
const ScriptWrapper* _scripts;
|
||||
const ScriptWrapper* nullable _scripts;
|
||||
i32 _size;
|
||||
i32 _index = -1;
|
||||
i32 _setIndex = -1;
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
#define CREATURELIB_SCRIPTCATEGORY_HPP
|
||||
#include <Arbutils/Enum.hpp>
|
||||
|
||||
ENUM(ScriptCategory, uint8_t, Attack, Talent, Status, Creature, Battle, Side, ItemBattleTrigger)
|
||||
ENUM(ScriptCategory, u8, Attack, Talent, Status, Creature, Battle, Side, ItemBattleTrigger)
|
||||
|
||||
#endif // CREATURELIB_SCRIPTCATEGORY_HPP
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
namespace CreatureLib::Battling {
|
||||
class ScriptSet {
|
||||
ArbUt::UniquePtrList<BattleScript> _scripts;
|
||||
ArbUt::Dictionary<uint32_t, size_t> _lookup;
|
||||
ArbUt::Dictionary<u32, size_t> _lookup;
|
||||
|
||||
public:
|
||||
~ScriptSet() = default;
|
||||
@@ -39,7 +39,7 @@ namespace CreatureLib::Battling {
|
||||
return Get(key.GetHash());
|
||||
}
|
||||
|
||||
ArbUt::OptionalBorrowedPtr<BattleScript> Get(uint32_t keyHash) const noexcept {
|
||||
ArbUt::OptionalBorrowedPtr<BattleScript> Get(u32 keyHash) const noexcept {
|
||||
auto v = _lookup.TryGet(keyHash);
|
||||
if (v.has_value()) {
|
||||
return _scripts[v.value()].GetRaw();
|
||||
@@ -49,7 +49,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
void Remove(const ArbUt::BasicStringView& key) { Remove(key.GetHash()); }
|
||||
|
||||
void Remove(uint32_t keyHash) {
|
||||
void Remove(u32 keyHash) {
|
||||
auto v = _lookup.TryGet(keyHash);
|
||||
if (v.has_value()) {
|
||||
auto script = _scripts[v.value()];
|
||||
@@ -69,7 +69,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
bool Has(const ArbUt::BasicStringView& key) const { return _lookup.Has(key); }
|
||||
|
||||
bool Has(uint32_t keyHash) const { return _lookup.Has(keyHash); }
|
||||
bool Has(u32 keyHash) const { return _lookup.Has(keyHash); }
|
||||
|
||||
inline size_t Count() const { return _scripts.Count(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user