2020-03-11 11:22:13 +00:00
|
|
|
#include "../../src/Battling/TurnChoices/AttackTurnChoice.hpp"
|
|
|
|
#include "../../src/Battling/TurnChoices/FleeTurnChoice.hpp"
|
|
|
|
#include "../../src/Battling/TurnChoices/PassTurnChoice.hpp"
|
|
|
|
#include "../../src/Battling/TurnChoices/SwitchTurnChoice.hpp"
|
2020-07-31 08:51:03 +00:00
|
|
|
#include "../Core.hpp"
|
2020-03-11 11:22:13 +00:00
|
|
|
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));
|
|
|
|
}
|
2020-07-26 09:37:05 +00:00
|
|
|
export void CreatureLib_AttackTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
|
2020-03-11 11:22:13 +00:00
|
|
|
export FleeTurnChoice* CreatureLib_FleeTurnChoice_Construct(Creature* user) { return new FleeTurnChoice(user); }
|
2020-07-26 09:37:05 +00:00
|
|
|
export void CreatureLib_FleeTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
|
2020-03-11 11:22:13 +00:00
|
|
|
export PassTurnChoice* CreatureLib_PassTurnChoice_Construct(Creature* user) { return new PassTurnChoice(user); }
|
2020-07-26 09:37:05 +00:00
|
|
|
export void CreatureLib_PassTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
|
2020-03-11 11:22:13 +00:00
|
|
|
export SwitchTurnChoice* CreatureLib_SwitchTurnChoice_Construct(Creature* user, Creature* newCreature) {
|
|
|
|
return new SwitchTurnChoice(user, newCreature);
|
|
|
|
}
|
2020-07-26 09:37:05 +00:00
|
|
|
export void CreatureLib_SwitchTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
|
2020-03-11 11:22:13 +00:00
|
|
|
|
|
|
|
SIMPLE_GET_FUNC(BaseTurnChoice, GetKind, TurnChoiceKind)
|
2020-07-07 13:33:43 +00:00
|
|
|
BORROWED_GET_FUNC(BaseTurnChoice, GetUser, Creature*)
|
2020-03-11 11:22:13 +00:00
|
|
|
|
2020-07-07 13:33:43 +00:00
|
|
|
BORROWED_GET_FUNC(AttackTurnChoice, GetAttack, LearnedAttack*)
|
2020-03-11 11:22:13 +00:00
|
|
|
SIMPLE_GET_FUNC(AttackTurnChoice, GetKind, TurnChoiceKind)
|
2020-03-25 18:07:36 +00:00
|
|
|
|
2020-07-26 09:24:31 +00:00
|
|
|
export uint8_t CreatureLib_AttackTurnChoice_GetPriority(int8_t& out, AttackTurnChoice* p) {
|
|
|
|
Try(out = p->GetPriority());
|
|
|
|
}
|
2020-03-25 18:07:36 +00:00
|
|
|
|
2020-07-07 13:33:43 +00:00
|
|
|
SMART_GET_FUNC(AttackTurnChoice, GetAttackScript, Script*)
|
2020-07-26 09:24:31 +00:00
|
|
|
export uint8_t CreatureLib_AttackTurnChoice_GetTargetSideIndex(const AttackTurnChoice* p) {
|
2020-03-11 11:22:13 +00:00
|
|
|
return p->GetTarget().GetSideIndex();
|
|
|
|
}
|
2020-07-26 09:24:31 +00:00
|
|
|
export uint8_t CreatureLib_AttackTurnChoice_GetTargetCreatureIndex(const AttackTurnChoice* p) {
|
2020-03-11 11:22:13 +00:00
|
|
|
return p->GetTarget().GetCreatureIndex();
|
|
|
|
}
|
|
|
|
|
2020-07-07 13:33:43 +00:00
|
|
|
BORROWED_GET_FUNC(SwitchTurnChoice, GetNewCreature, Creature*)
|