CreatureLib/CInterface/Battling/BattleRandom.cpp

21 lines
1.0 KiB
C++
Raw Normal View History

2020-04-04 16:24:59 +00:00
#include "../../src/Battling/Models/BattleRandom.hpp"
#include "../Core.hpp"
2020-04-04 16:24:59 +00:00
using namespace CreatureLib::Battling;
2022-04-02 10:33:26 +00:00
export_func BattleRandom* CreatureLib_BattleRandom_Construct() { return new BattleRandom(); }
export_func BattleRandom* CreatureLib_BattleRandom_ConstructWithSeed(uint_fast32_t seed) {
return new BattleRandom(seed);
}
2020-04-04 16:24:59 +00:00
2022-04-02 10:33:26 +00:00
export_func void CreatureLib_BattleRandom_Destruct(BattleRandom* p) { delete p; }
2020-04-04 16:24:59 +00:00
2022-04-02 10:33:26 +00:00
export_func i8 CreatureLib_BattleRandom_EffectChance(bool& out, BattleRandom* p, float chance, ExecutingAttack* attack,
Creature* target) {
2020-04-04 16:24:59 +00:00
Try(out = p->EffectChance(chance, attack, target);)
}
2022-04-02 10:33:26 +00:00
export_func i32 CreatureLib_BattleRandom_Get(BattleRandom* p) { return p->Get(); }
export_func i32 CreatureLib_BattleRandom_GetMax(BattleRandom* p, i32 max) { return p->Get(max); }
export_func i32 CreatureLib_BattleRandom_GetMinMax(BattleRandom* p, i32 min, i32 max) { return p->Get(min, max); }
export_func uint_fast32_t CreatureLib_BattleRandom_GetSeed(BattleRandom* p) { return p->GetSeed(); }