MyGame - YosefTwito/PackIt GitHub Wiki

MyGame:

  • This class represents the game.

  • We need to fetch the amount of robots and fruits.

  • Than we need to implement the game as expected.

  • One implementation is an auto-play with directed scenario according to the files.

  • Another is manual-play where we decide where to point the robot.

  • The class also has algorithms to play the auto-player.

  • @authors YosefTwito and EldarTakach


Methods:

  1. fruitToEdge(Fruit f ,graph g) - Computes the edge that the fruit that has been given is sitting on.
  2. robo_update(int mode) - updates the location of the robots, also in charge of manuring the robots in case of manual play.
  3. fru_update() - updates the location of the fruits.
  4. Score(ArrayList) - computes the score of each robot and the total score of the player.
  5. nextNodeManual(Robot r,int src,int dest) - checks if the manual player chose a valid move and preforms it.
  6. nextNode() - random walk on the graph.
  7. goNext() - calculates the node that its best to go to.
  8. goGo() - the main driver of the game.
⚠️ **GitHub.com Fallback** ⚠️