More work on basic turn layout.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-02 13:57:43 +01:00
parent d7fee13002
commit fc675efdf5
11 changed files with 122 additions and 17 deletions

View File

@@ -10,7 +10,7 @@ using namespace CreatureLib::Battling;
TEST_CASE( "Turn ordering: Attack before pass", "[Battling]" ) {
auto choice1 = new PassTurnChoice(nullptr);
auto choice2 = new AttackTurnChoice(nullptr, nullptr);
auto choice2 = new AttackTurnChoice(nullptr, nullptr, Target(0,0));
auto vec = std::vector<const BaseTurnChoice*>{choice1, choice2};
auto rand = Core::Random();
TurnOrdering::OrderChoices(vec,rand);
@@ -29,8 +29,8 @@ TEST_CASE( "Turn ordering: High priority goes before no priority", "[Battling]"
auto l = GetLibrary()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("standard"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("highPriority"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1);
auto choice2 = new AttackTurnChoice(nullptr, a2);
auto choice1 = new AttackTurnChoice(nullptr, a1, Target(0,0));
auto choice2 = new AttackTurnChoice(nullptr, a2, Target(0,0));
auto vec = std::vector<const BaseTurnChoice*>{choice1, choice2};
auto rand = Core::Random();
TurnOrdering::OrderChoices(vec,rand);
@@ -51,8 +51,8 @@ TEST_CASE( "Turn ordering: Higher priority goes before high priority", "[Battlin
auto l = GetLibrary()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("highPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("higherPriority"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1);
auto choice2 = new AttackTurnChoice(nullptr, a2);
auto choice1 = new AttackTurnChoice(nullptr, a1, Target(0,0));
auto choice2 = new AttackTurnChoice(nullptr, a2, Target(0,0));
auto vec = std::vector<const BaseTurnChoice*>{choice1, choice2};
auto rand = Core::Random();
TurnOrdering::OrderChoices(vec,rand);
@@ -73,8 +73,8 @@ TEST_CASE( "Turn ordering: High priority goes before low priority", "[Battling]"
auto l = GetLibrary()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("lowPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("higherPriority"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1);
auto choice2 = new AttackTurnChoice(nullptr, a2);
auto choice1 = new AttackTurnChoice(nullptr, a1, Target(0,0));
auto choice2 = new AttackTurnChoice(nullptr, a2, Target(0,0));
auto vec = std::vector<const BaseTurnChoice*>{choice1, choice2};
auto rand = Core::Random();
TurnOrdering::OrderChoices(vec,rand);
@@ -95,8 +95,8 @@ TEST_CASE( "Turn ordering: No priority goes before low priority", "[Battling]" )
auto l = GetLibrary()->GetAttackLibrary();
auto a1 = new LearnedAttack(l->GetAttack("lowPriority"), AttackLearnMethod::Unknown);
auto a2 = new LearnedAttack(l->GetAttack("standard"), AttackLearnMethod::Unknown);
auto choice1 = new AttackTurnChoice(nullptr, a1);
auto choice2 = new AttackTurnChoice(nullptr, a2);
auto choice1 = new AttackTurnChoice(nullptr, a1, Target(0,0));
auto choice2 = new AttackTurnChoice(nullptr, a2, Target(0,0));
auto vec = std::vector<const BaseTurnChoice*>{choice1, choice2};
auto rand = Core::Random();
TurnOrdering::OrderChoices(vec,rand);