From ed287f93dbae3449bc784e67594457a20352b6d2 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 22 Feb 2020 16:10:22 +0100 Subject: [PATCH] Update CreatureLib, added AddVolatile function to AngelScript. --- conanfile.py | 2 +- .../TypeRegistry/Battling/RegisterBattleClass.cpp | 7 +++++-- .../TypeRegistry/Battling/RegisterPokemonClass.cpp | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index 3942fa4..90671d6 100644 --- a/conanfile.py +++ b/conanfile.py @@ -45,7 +45,7 @@ class PkmnLibConan(ConanFile): self.options["AngelScript"].link_std_statically = True def requirements(self): - self.requires("CreatureLib/32584ac4067d5997d4f8bfaa33dbfc407b19fb05@creaturelib/master") + self.requires("CreatureLib/645ba95bbc46f4add28ba6440a707e89ea609a25@creaturelib/master") if self.options.script_handler == "angelscript": self.requires("AngelScript/2.34@AngelScript/Deukhoofd") else: diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp index fda0207..e1094f9 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp @@ -17,8 +17,7 @@ void RegisterBattleClass::RegisterChoiceQueue(asIScriptEngine* engine) { asCALL_THISCALL); assert(r >= 0); r = engine->RegisterObjectMethod("ChoiceQueue", "const BaseTurnChoice@ Peek() const", - asMETHOD(CreatureLib::Battling::ChoiceQueue, Peek), - asCALL_THISCALL); + asMETHOD(CreatureLib::Battling::ChoiceQueue, Peek), asCALL_THISCALL); assert(r >= 0); } @@ -61,4 +60,8 @@ void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) { r = engine->RegisterObjectMethod("Battle", "ChoiceQueue@ get_TurnQueue() const property", asMETHOD(CreatureLib::Battling::Battle, GetCurrentTurnQueue), asCALL_THISCALL); assert(r >= 0); + r = engine->RegisterObjectMethod( + "Battle", "void AddVolatile(const string &in name) const property", + asMETHODPR(CreatureLib::Battling::Battle, AddVolatileScript, (const std::string&), void), asCALL_THISCALL); + assert(r >= 0); } diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp index 2aa8f6a..4c405fd 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp @@ -175,4 +175,8 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) { r = engine->RegisterObjectMethod("Pokemon", "int8 GetStatBoost(Statistic stat) const", asMETHOD(PkmnLib::Battling::Pokemon, GetStatBoost), asCALL_THISCALL); assert(r >= 0); + r = engine->RegisterObjectMethod( + "Pokemon", "void AddVolatile(const string &in name) const property", + asMETHODPR(PkmnLib::Battling::Pokemon, AddVolatileScript, (const std::string&), void), asCALL_THISCALL); + assert(r >= 0); } \ No newline at end of file