Implement basic library class that other libraries inherit from for performance.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-15 18:51:21 +01:00
parent a47f60cdf7
commit d6ea16b467
11 changed files with 87 additions and 195 deletions

View File

@@ -22,25 +22,25 @@ BattleLibrary* TestLibrary::Get() {
SpeciesLibrary* TestLibrary::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));
l->Insert("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));
return l;
}
AttackLibrary* TestLibrary::BuildAttackLibrary() {
auto l = new AttackLibrary();
l->LoadAttack("standard", new AttackData("standard", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 0, {}));
l->LoadAttack("highPriority", new AttackData("highPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 1, {}));
l->LoadAttack("higherPriority", new AttackData("higherPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 2, {}));
l->LoadAttack("lowPriority", new AttackData("lowPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, -1, {}));
l->Insert("standard", new AttackData("standard", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 0, {}));
l->Insert("highPriority", new AttackData("highPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 1, {}));
l->Insert("higherPriority", new AttackData("higherPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 2, {}));
l->Insert("lowPriority", new AttackData("lowPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, -1, {}));
return l;
}