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:

    1. Creates a game_service [0,23] (line 36)
    1. Constructs the graph from JSON String (lines 37-39)
    1. Gets the scenario JSON String (lines 40-41)
    1. Prints the fruits data (lines 49-50)
    1. Add a set of robots (line 52-53) // note: in general a list of robots should be added
    1. Starts game (line 57)
    1. Main loop (should be a thread) (lines 59-60)
    1. move the robot along the current edge (line 74)
    1. direct to the next edge (if on a node) (line 87-88)
    1. prints the game results (after "game over"): (line 63)
  • @author boaz.benmoshe