Coverage report for gui


src/
File: src/parser/Incantation.hpp
Date: 2024-06-25 10:57:02
Lines:
8/8
100.0%
Functions:
1/1
100.0%
Branches:
13/31
41.9%

Line Branch Exec Source
1 #ifndef INCANTATION_HPP
2 #define INCANTATION_HPP
3
4 #include <vector>
5
6 enum IncantationOutcome
7 {
8 FAILURE,
9 SUCCESS,
10 IN_PROGRESS
11 };
12
13 class Incantation
14 {
15 private:
16 std::vector<int> pos;
17 int lvl;
18 std::vector<int> playersIds;
19 IncantationOutcome status = IN_PROGRESS;
20 public:
21
1/2
✓ Branch 2 taken 12 times.
✗ Branch 3 not taken.
12 Incantation(std::vector<int> pos, int lvl, std::vector<int> playersIds) : pos(pos), lvl(lvl), playersIds(playersIds) {};
22 5 ~Incantation() {};
23
24
6/10
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
6 void setStatus(IncantationOutcome status) { this->status = status; };
25
1/4
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
2 IncantationOutcome getStatus() { return this->status; };
26
27
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 void addPlayer(int playerId) { this->playersIds.push_back(playerId); };
28
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 std::vector<int> getPlayersId() { return this->playersIds; };
29
30
2/8
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
8 std::vector<int> getPosition() { return {this->pos}; };
31
1/3
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
2 int getLvl() { return this->lvl; };
32 };
33
34
35 #endif // INCANTATION_HPP
36