| 912 | } |
| 913 | |
| 914 | bool Agent::getNewGoal(GameState &state) |
| 915 | { |
| 916 | bool popped = false; |
| 917 | bool acquired = false; |
| 918 | // Pop finished missions if present |
| 919 | popped = popFinishedMissions(state); |
| 920 | do |
| 921 | { |
| 922 | // Try to get new destination |
| 923 | if (!missions.empty()) |
| 924 | { |
| 925 | acquired = missions.front().getNextDestination(state, *this, goalPosition); |
| 926 | } |
| 927 | // Pop finished missions if present |
| 928 | popped = popFinishedMissions(state); |
| 929 | } while (popped && !acquired); |
| 930 | return acquired; |
| 931 | } |
| 932 | |
| 933 | void Agent::die(GameState &state, bool silent) |
| 934 | { |
nothing calls this directly
no test coverage detected