Coverage report for ai


src/
File: src/run/listeners/ListenTakeResponse.cpp
Date: 2024-06-25 10:57:00
Lines:
0/20
0.0%
Functions:
0/1
0.0%
Branches:
0/24
0.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2024
3 ** zappy/ai
4 ** File description:
5 ** ListenTakeResponse.cpp
6 */
7
8 #include "../../bots/ABot.hpp"
9
10 // TODO: find a cleaner way to do this
11 void ABot::listenTakeResponse(const std::string &response)
12 {
13 if (_state.lastAction.parameter == "linemate")
14 {
15 if (response == "ok")
16 {
17 _state.ressources.linemate += 1;
18 }
19 }
20 else if (_state.lastAction.parameter == "deraumere")
21 {
22 if (response == "ok")
23 {
24 _state.ressources.deraumere += 1;
25 }
26 }
27 else if (_state.lastAction.parameter == "sibur")
28 {
29 if (response == "ok")
30 {
31 _state.ressources.sibur += 1;
32 }
33 }
34 else if (_state.lastAction.parameter == "mendiane")
35 {
36 if (response == "ok")
37 {
38 _state.ressources.mendiane += 1;
39 }
40 }
41 else if (_state.lastAction.parameter == "phiras")
42 {
43 if (response == "ok")
44 {
45 _state.ressources.phiras += 1;
46 }
47 }
48 else if (_state.lastAction.parameter == "thystame")
49 {
50 if (response == "ok")
51 {
52 _state.ressources.thystame += 1;
53 }
54 }
55 }
56