36 lines
1.8 KiB
C++
36 lines
1.8 KiB
C++
#include "../../src/Battling/TurnChoices/AttackTurnChoice.hpp"
|
|
#include "../../src/Battling/TurnChoices/FleeTurnChoice.hpp"
|
|
#include "../../src/Battling/TurnChoices/PassTurnChoice.hpp"
|
|
#include "../../src/Battling/TurnChoices/SwitchTurnChoice.hpp"
|
|
#include "../Core.hpp"
|
|
using namespace CreatureLib::Battling;
|
|
|
|
export AttackTurnChoice* CreatureLib_AttackTurnChoice_Construct(Creature* user, LearnedAttack* attack,
|
|
uint8_t sideIndex, uint8_t targetIndex) {
|
|
return new AttackTurnChoice(user, attack, CreatureIndex(sideIndex, targetIndex));
|
|
}
|
|
export FleeTurnChoice* CreatureLib_FleeTurnChoice_Construct(Creature* user) { return new FleeTurnChoice(user); }
|
|
export PassTurnChoice* CreatureLib_PassTurnChoice_Construct(Creature* user) { return new PassTurnChoice(user); }
|
|
export SwitchTurnChoice* CreatureLib_SwitchTurnChoice_Construct(Creature* user, Creature* newCreature) {
|
|
return new SwitchTurnChoice(user, newCreature);
|
|
}
|
|
|
|
export void CreatureLib_BaseTurnChoice_Destruct(const BaseTurnChoice* p) { delete p; }
|
|
|
|
SIMPLE_GET_FUNC(BaseTurnChoice, GetKind, TurnChoiceKind)
|
|
BORROWED_GET_FUNC(BaseTurnChoice, GetUser, Creature*)
|
|
|
|
BORROWED_GET_FUNC(AttackTurnChoice, GetAttack, LearnedAttack*)
|
|
SIMPLE_GET_FUNC(AttackTurnChoice, GetKind, TurnChoiceKind)
|
|
|
|
export uint8_t CreatureLib_BaseTurnChoice_GetPriority(int8_t& out, AttackTurnChoice* p) { Try(out = p->GetPriority()); }
|
|
|
|
SMART_GET_FUNC(AttackTurnChoice, GetAttackScript, Script*)
|
|
export uint8_t CreatureLib_BaseTurnChoice_GetTargetSideIndex(const AttackTurnChoice* p) {
|
|
return p->GetTarget().GetSideIndex();
|
|
}
|
|
export uint8_t CreatureLib_BaseTurnChoice_GetTargetCreatureIndex(const AttackTurnChoice* p) {
|
|
return p->GetTarget().GetCreatureIndex();
|
|
}
|
|
|
|
BORROWED_GET_FUNC(SwitchTurnChoice, GetNewCreature, Creature*) |