CreatureLib/CInterface/Battling/HistoryHandler.cpp

24 lines
937 B
C++
Raw Normal View History

#include "../../src/Battling/History/HistoryElements/AttackUseHistory.hpp"
#include "../../src/Battling/History/HistoryHolder.hpp"
#include "../Core.hpp"
using namespace CreatureLib::Battling;
export const HistoryElement* CreatureLib_HistoryHandler_GetTopElement(const HistoryHolder* p) {
return p->GetTopElement().GetRaw();
}
export const HistoryElement* CreatureLib_HistoryHandler_GetLastUsedAttack(const HistoryHolder* p) {
auto res = p->GetLastUsedAttack();
if (res.has_value()) {
return res.value();
}
return nullptr;
}
export HistoryElementKind CreatureLib_HistoryElement_GetKind(const HistoryElement* p) { return p->GetKind(); }
export const HistoryElement* CreatureLib_HistoryElement_GetPrevious(const HistoryElement* p) {
return p->GetPrevious().GetRaw();
}
export const ExecutingAttack* CreatureLib_AttackUseHistory_GetAttack(const AttackUseHistory* p) {
return p->GetAttack().GetRaw();
}