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

@@ -28,8 +28,8 @@ TEST_CASE("Turn ordering: Attack before pass", "[Battling]") {
TEST_CASE("Turn ordering: High priority goes before no priority", "[Battling]") {
auto l = TestLibrary::Get()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("standard"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("highPriority"), AttackLearnMethod::Unknown);
auto a1 = new LearnedAttack(l->Get("standard"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->Get("highPriority"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1, CreatureIndex(0, 0));
auto choice2 = new AttackTurnChoice(nullptr, a2, CreatureIndex(0, 0));
auto vec = std::vector<BaseTurnChoice*>{choice1, choice2};
@@ -50,8 +50,8 @@ TEST_CASE("Turn ordering: High priority goes before no priority", "[Battling]")
TEST_CASE("Turn ordering: Higher priority goes before high priority", "[Battling]") {
auto l = TestLibrary::Get()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("highPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("higherPriority"), AttackLearnMethod::Unknown);
auto a1 = new LearnedAttack(l->Get("highPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->Get("higherPriority"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1, CreatureIndex(0, 0));
auto choice2 = new AttackTurnChoice(nullptr, a2, CreatureIndex(0, 0));
auto vec = std::vector<BaseTurnChoice*>{choice1, choice2};
@@ -72,8 +72,8 @@ TEST_CASE("Turn ordering: Higher priority goes before high priority", "[Battling
TEST_CASE("Turn ordering: High priority goes before low priority", "[Battling]") {
auto l = TestLibrary::Get()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("lowPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("higherPriority"), AttackLearnMethod::Unknown);
auto a1 = new LearnedAttack(l->Get("lowPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->Get("higherPriority"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1, CreatureIndex(0, 0));
auto choice2 = new AttackTurnChoice(nullptr, a2, CreatureIndex(0, 0));
auto vec = std::vector<BaseTurnChoice*>{choice1, choice2};
@@ -94,8 +94,8 @@ TEST_CASE("Turn ordering: High priority goes before low priority", "[Battling]")
TEST_CASE("Turn ordering: No priority goes before low priority", "[Battling]") {
auto l = TestLibrary::Get()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("lowPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("standard"), AttackLearnMethod::Unknown);
auto a1 = new LearnedAttack(l->Get("lowPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->Get("standard"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1, CreatureIndex(0, 0));
auto choice2 = new AttackTurnChoice(nullptr, a2, CreatureIndex(0, 0));
auto vec = std::vector<BaseTurnChoice*>{choice1, choice2};