Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-28 12:55:22 +01:00
parent 3b685ae782
commit a8730d983f
91 changed files with 946 additions and 1121 deletions

View File

@@ -7,41 +7,41 @@ using namespace CreatureLib::Library;
using namespace CreatureLib::Battling;
static BattleLibrary* __library = nullptr;
static SpeciesLibrary* BuildSpeciesLibrary(){
static SpeciesLibrary* BuildSpeciesLibrary() {
auto l = new SpeciesLibrary();
l->LoadSpecies("testSpecies1", new CreatureSpecies(0, "testSpecies1",
new SpeciesVariant("default", 1,1, 10, {0, 1},
StatisticSet<uint16_t >(10,10,10,10,10,10),
{"testTalent"}, {"testSecretTalent"},
new LearnableAttacks(100)),
0.5f, "testGrowthRate", 5, 100));
l->LoadSpecies("testSpecies1",
new CreatureSpecies(
0, "testSpecies1",
new SpeciesVariant("default", 1, 1, 10, {0, 1}, StatisticSet<uint16_t>(10, 10, 10, 10, 10, 10),
{"testTalent"}, {"testSecretTalent"}, new LearnableAttacks(100)),
0.5f, "testGrowthRate", 5, 100));
return l;
}
static AttackLibrary* BuildAttackLibrary(){
static AttackLibrary* BuildAttackLibrary() {
auto l = new AttackLibrary();
l->LoadAttack("standard", new AttackData("standard", "normal", AttackCategory::Physical,
20, 100, 30, AttackTarget::AdjacentOpponent,0, {}));
l->LoadAttack("highPriority", new AttackData("highPriority", "normal", AttackCategory::Physical,
20, 100, 30, AttackTarget::AdjacentOpponent,1, {}));
l->LoadAttack("higherPriority", new AttackData("higherPriority", "normal", AttackCategory::Physical,
20, 100, 30, AttackTarget::AdjacentOpponent,2, {}));
l->LoadAttack("lowPriority", new AttackData("lowPriority", "normal", AttackCategory::Physical,
20, 100, 30, AttackTarget::AdjacentOpponent,-1, {}));
l->LoadAttack("standard", new AttackData("standard", "normal", AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 0, {}));
l->LoadAttack("highPriority", new AttackData("highPriority", "normal", AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 1, {}));
l->LoadAttack("higherPriority", new AttackData("higherPriority", "normal", AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 2, {}));
l->LoadAttack("lowPriority", new AttackData("lowPriority", "normal", AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, -1, {}));
return l;
}
static ItemLibrary* BuildItemLibrary(){
static ItemLibrary* BuildItemLibrary() {
auto l = new ItemLibrary();
return l;
}
static GrowthRateLibrary* BuildGrowthRateLibrary(){
static GrowthRateLibrary* BuildGrowthRateLibrary() {
auto l = new GrowthRateLibrary();
return l;
}
static TypeLibrary* BuildTypeLibrary(){
static TypeLibrary* BuildTypeLibrary() {
auto l = new TypeLibrary();
l->RegisterType("testType1");
l->RegisterType("testType2");
@@ -49,17 +49,16 @@ static TypeLibrary* BuildTypeLibrary(){
return l;
}
static BattleLibrary* BuildLibrary(){
auto l = new DataLibrary(LibrarySettings(100, 4), BuildSpeciesLibrary(), BuildAttackLibrary(),
BuildItemLibrary(), BuildGrowthRateLibrary(), BuildTypeLibrary());
auto battleLib = new BattleLibrary(l, new BattleStatCalculator(), new DamageLibrary(),
new CriticalLibrary(), new ScriptResolver());
static BattleLibrary* BuildLibrary() {
auto l = new DataLibrary(LibrarySettings(100, 4), BuildSpeciesLibrary(), BuildAttackLibrary(), BuildItemLibrary(),
BuildGrowthRateLibrary(), BuildTypeLibrary());
auto battleLib = new BattleLibrary(l, new BattleStatCalculator(), new DamageLibrary(), new CriticalLibrary(),
new ScriptResolver());
return battleLib;
}
[[maybe_unused]]
static BattleLibrary* GetLibrary(){
if (__library == nullptr){
[[maybe_unused]] static BattleLibrary* GetLibrary() {
if (__library == nullptr) {
__library = BuildLibrary();
}
return __library;