SimpleGameClient - VadimKachevski/OOP_Ex3 GitHub Wiki
SimpleGameClient
-
This class represents a simple example for using the GameServer API:
-
the main file performs the following tasks:
-
- Creates a game_service [0,23] (line 36)
-
- Constructs the graph from JSON String (lines 37-39)
-
- Gets the scenario JSON String (lines 40-41)
-
- Prints the fruits data (lines 49-50)
-
- Add a set of robots (line 52-53) // note: in general a list of robots should be added
-
- Starts game (line 57)
-
- Main loop (should be a thread) (lines 59-60)
-
- move the robot along the current edge (line 74)
-
- direct to the next edge (if on a node) (line 87-88)
-
- prints the game results (after "game over"): (line 63)
-
@author boaz.benmoshe