From d4ece51866fbb93df97b6bd03e140f1134457f26 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 30 Oct 2021 18:18:40 +0200 Subject: [PATCH] Adds more Angelscript functions to HistoryElement base class. --- .../TypeRegistry/Battling/RegisterBattleHistory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleHistory.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleHistory.cpp index ab53a5f..a904b76 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleHistory.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleHistory.cpp @@ -37,6 +37,13 @@ BORROWED_PTR_GETTER_FUNC(AttackUseHistory, const ExecutingAttack, GetAttack); void RegisterBattleHistory::RegisterHistoryElement(asIScriptEngine* engine) { Ensure(engine->RegisterObjectType("HistoryElement", 0, asOBJ_REF | asOBJ_NOCOUNT) >= 0); + RegisterGetter, &HistoryElement::GetPrevious>( + engine, "HistoryElement", "const HistoryElement@ get_Previous() const property"); + RegisterGetter( + engine, "HistoryElement", "HistoryElementKind get_Kind() const property"); + RegisterGetter(engine, "HistoryElement", + "uint32 get_TurnNumber() const property"); + RegisterHistoryElementType(engine, "DamageHistory"); Ensure(engine->RegisterObjectMethod("DamageHistory", "Pokemon@ get_Target() const property", asFunctionPtr(GetTargetWrapper), asCALL_CDECL_OBJFIRST) >= 0);