Make ChoiceQueue use smart pointers.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-31 18:00:39 +02:00
parent ff181204ae
commit 29cb4eac37
8 changed files with 32 additions and 35 deletions

View File

@@ -25,20 +25,16 @@ TEST_CASE("Move creature choice up next.", "[Battling]") {
auto choiceQueue = ChoiceQueue(choices);
CHECK(choiceQueue.MoveCreatureChoiceNext(c4));
auto currentChoices = choiceQueue.GetInnerQueue();
auto& currentChoices = choiceQueue.GetInnerQueue();
CHECK(currentChoices[0]->GetUser() == c4);
CHECK(currentChoices[1]->GetUser() == c1);
CHECK(currentChoices[2]->GetUser() == c2);
CHECK(currentChoices[3]->GetUser() == c3);
CHECK_FALSE(choiceQueue.MoveCreatureChoiceNext(c4));
delete choiceQueue.Dequeue();
delete choiceQueue.Dequeue();
choiceQueue.Dequeue();
choiceQueue.Dequeue();
CHECK_FALSE(choiceQueue.MoveCreatureChoiceNext(c1));
delete choiceQueue.Dequeue();
delete choiceQueue.Dequeue();
delete c1;
delete c2;
delete c3;