Add individual C Interface destructors for turn choices.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-07-26 11:37:05 +02:00
parent 141f0338bf
commit a6ed6d63cc
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 4 additions and 2 deletions

View File

@ -9,13 +9,15 @@ export AttackTurnChoice* CreatureLib_AttackTurnChoice_Construct(Creature* user,
uint8_t sideIndex, uint8_t targetIndex) {
return new AttackTurnChoice(user, attack, CreatureIndex(sideIndex, targetIndex));
}
export void CreatureLib_AttackTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
export FleeTurnChoice* CreatureLib_FleeTurnChoice_Construct(Creature* user) { return new FleeTurnChoice(user); }
export void CreatureLib_FleeTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
export PassTurnChoice* CreatureLib_PassTurnChoice_Construct(Creature* user) { return new PassTurnChoice(user); }
export void CreatureLib_PassTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
export SwitchTurnChoice* CreatureLib_SwitchTurnChoice_Construct(Creature* user, Creature* newCreature) {
return new SwitchTurnChoice(user, newCreature);
}
export void CreatureLib_BaseTurnChoice_Destruct(const BaseTurnChoice* p) { delete p; }
export void CreatureLib_SwitchTurnChoice_Destruct(AttackTurnChoice* p) { delete p; }
SIMPLE_GET_FUNC(BaseTurnChoice, GetKind, TurnChoiceKind)
BORROWED_GET_FUNC(BaseTurnChoice, GetUser, Creature*)