Move several classes from Core to Arbutils.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-02-26 13:51:16 +01:00
parent 428b318baf
commit 5e6572aca5
24 changed files with 51 additions and 384 deletions

View File

@@ -6,7 +6,7 @@
using namespace CreatureLib;
using namespace Battling;
bool ___ChoiceOrderFunc(const BaseTurnChoice* a, const BaseTurnChoice* b, Core::Random& rand) {
bool ___ChoiceOrderFunc(const BaseTurnChoice* a, const BaseTurnChoice* b, Arbutils::Random& rand) {
auto aKind = a->GetKind();
auto bKind = b->GetKind();
if (aKind != bKind)
@@ -26,7 +26,7 @@ bool ___ChoiceOrderFunc(const BaseTurnChoice* a, const BaseTurnChoice* b, Core::
return randomValue == 0;
}
void TurnOrdering::OrderChoices(std::vector<BaseTurnChoice*>& vec, Core::Random& rand) {
void TurnOrdering::OrderChoices(std::vector<BaseTurnChoice*>& vec, Arbutils::Random& rand) {
auto comp = [&](const BaseTurnChoice* a, const BaseTurnChoice* b) -> bool {
return ___ChoiceOrderFunc(a, b, rand);
};

View File

@@ -1,14 +1,14 @@
#ifndef CREATURELIB_TURNORDERING_HPP
#define CREATURELIB_TURNORDERING_HPP
#include <Arbutils/Random.hpp>
#include <vector>
#include "../../Core/Random.hpp"
#include "../TurnChoices/BaseTurnChoice.hpp"
namespace CreatureLib::Battling {
class TurnOrdering {
public:
static void OrderChoices(std::vector<BaseTurnChoice*>& vec, CreatureLib::Core::Random& rand);
static void OrderChoices(std::vector<BaseTurnChoice*>& vec, Arbutils::Random& rand);
};
}

View File

@@ -1,7 +1,7 @@
#ifndef CREATURELIB_BATTLERANDOM_HPP
#define CREATURELIB_BATTLERANDOM_HPP
#include "../../Core/Random.hpp"
#include <Arbutils/Random.hpp>
namespace CreatureLib::Battling {
class ExecutingAttack;
@@ -9,7 +9,7 @@ namespace CreatureLib::Battling {
class BattleRandom {
private:
Core::Random _random;
Arbutils::Random _random;
public:
BattleRandom() : _random() {}
@@ -19,7 +19,7 @@ namespace CreatureLib::Battling {
int32_t Get() { return _random.Get(); }
int32_t Get(int32_t max) { return _random.Get(max); }
int32_t Get(int32_t min, int32_t max) { return _random.Get(min, max); }
Core::Random& GetRNG() { return _random; }
Arbutils::Random& GetRNG() { return _random; }
};
}

View File

@@ -30,7 +30,7 @@ CreateCreature* CreateCreature::WithAttack(const std::string& attackName, Attack
}
Creature* CreateCreature::Create() {
auto rand = Core::Random();
auto rand = Arbutils::Random();
auto species = this->_library->GetSpeciesLibrary()->Get(this->_species.c_str());
auto variant = species->GetVariant(this->_variant);
int8_t talent;

View File

@@ -1,8 +1,8 @@
#ifndef CREATURELIB_SCRIPTRESOLVER_HPP
#define CREATURELIB_SCRIPTRESOLVER_HPP
#include <Arbutils/Enum.hpp>
#include <string>
#include "../../Core/Enum.hpp"
#include "Script.hpp"
#include "ScriptCategory.hpp"