Added lots of security using asserts.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-03-22 13:42:26 +01:00
parent 970ca8ddd5
commit 899e432271
35 changed files with 138 additions and 56 deletions

View File

@@ -10,8 +10,10 @@ using namespace CreatureLib;
using namespace CreatureLib::Battling;
TEST_CASE("Turn ordering: Attack before pass", "[Battling]") {
auto lib = TestLibrary::Get();
auto learnedAttack = LearnedAttack(lib->GetAttackLibrary()->Get("standard"_cnc), AttackLearnMethod::Unknown);
auto choice1 = new PassTurnChoice(nullptr);
auto choice2 = new AttackTurnChoice(nullptr, nullptr, CreatureIndex(0, 0));
auto choice2 = new AttackTurnChoice(nullptr, &learnedAttack, CreatureIndex(0, 0));
auto vec = std::vector<BaseTurnChoice*>{choice1, choice2};
auto rand = Arbutils::Random();
TurnOrdering::OrderChoices(vec, rand);