autoGame - VadimKachevski/OOP_Ex3 GitHub Wiki

autoGame

package gameClient

This class represents the automatic phase of the Maze of Waze.

This class is represented by a single object of MyGameGui.

Functions of autoGame:

public autoGame(MyGameGUI mgg) – a constructor which gets an already build up object of MyGameGui.

public void play(String gameNumStr) – this method receives a string which represents the scenario of the game (which level the user chose to play) and if it’s a valid input it calls the startGame method for running the auto phase.

private void startGame(int numberOfGame) – by a given of a valid number verified by the previous method, this function starts the game by setting up the server and starts the KML Thread which uploads to the KML information about the amount of moves and grades collected so far. In addition the method calls the move method to perform the movement of the Bots. This method in addition shows the time of the game to end.

private void move(game_service game) – by receiving the server (which holds the data and updates it as the game is running), this algorithm calculates the next step of the robot and sends the server the information of which Bot to move and to which index.