Implements ConstString in several core places in the library, improving performance.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-27 18:23:23 +01:00
parent 1d3a8da99e
commit 412e0a4d63
17 changed files with 161 additions and 148 deletions

View File

@@ -22,25 +22,25 @@ BattleLibrary* TestLibrary::Get() {
SpeciesLibrary* TestLibrary::BuildSpeciesLibrary() {
auto l = new SpeciesLibrary();
l->Insert("testSpecies1",
new CreatureSpecies(0, "testSpecies1",
l->Insert("testSpecies1"_cnc,
new CreatureSpecies(0, "testSpecies1"_cnc,
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));
0.5f, "testGrowthRate"_cnc, 5));
return l;
}
AttackLibrary* TestLibrary::BuildAttackLibrary() {
auto l = new AttackLibrary();
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, {}));
l->Insert("standard"_cnc, new AttackData("standard", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 0, {}));
l->Insert("highPriority"_cnc, new AttackData("highPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 1, {}));
l->Insert("higherPriority"_cnc, new AttackData("higherPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, 2, {}));
l->Insert("lowPriority"_cnc, new AttackData("lowPriority", 0, AttackCategory::Physical, 20, 100, 30,
AttackTarget::AdjacentOpponent, -1, {}));
return l;
}
@@ -51,7 +51,7 @@ ItemLibrary* TestLibrary::BuildItemLibrary() {
GrowthRateLibrary* TestLibrary::BuildGrowthRateLibrary() {
auto l = new GrowthRateLibrary();
l->AddGrowthRate("testGrowthRate", new LookupGrowthRate());
l->AddGrowthRate("testGrowthRate"_cnc, new LookupGrowthRate());
return l;
}