Adds more Angelscript functions to HistoryElement base class.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-10-30 18:18:40 +02:00
parent abaee62582
commit d4ece51866
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 7 additions and 0 deletions

View File

@ -37,6 +37,13 @@ BORROWED_PTR_GETTER_FUNC(AttackUseHistory, const ExecutingAttack, GetAttack);
void RegisterBattleHistory::RegisterHistoryElement(asIScriptEngine* engine) { void RegisterBattleHistory::RegisterHistoryElement(asIScriptEngine* engine) {
Ensure(engine->RegisterObjectType("HistoryElement", 0, asOBJ_REF | asOBJ_NOCOUNT) >= 0); Ensure(engine->RegisterObjectType("HistoryElement", 0, asOBJ_REF | asOBJ_NOCOUNT) >= 0);
RegisterGetter<HistoryElement, ArbUt::OptionalBorrowedPtr<HistoryElement>, &HistoryElement::GetPrevious>(
engine, "HistoryElement", "const HistoryElement@ get_Previous() const property");
RegisterGetter<HistoryElement, HistoryElementKind, &HistoryElement::GetKind>(
engine, "HistoryElement", "HistoryElementKind get_Kind() const property");
RegisterGetter<HistoryElement, u32, &HistoryElement::GetTurnNumber>(engine, "HistoryElement",
"uint32 get_TurnNumber() const property");
RegisterHistoryElementType<DamageHistory>(engine, "DamageHistory"); RegisterHistoryElementType<DamageHistory>(engine, "DamageHistory");
Ensure(engine->RegisterObjectMethod("DamageHistory", "Pokemon@ get_Target() const property", Ensure(engine->RegisterObjectMethod("DamageHistory", "Pokemon@ get_Target() const property",
asFunctionPtr(GetTargetWrapper), asCALL_CDECL_OBJFIRST) >= 0); asFunctionPtr(GetTargetWrapper), asCALL_CDECL_OBJFIRST) >= 0);