Robot - rotemish7/OOP_Ex3-4 GitHub Wiki

This class represents the robots of the game.

The number of robots is different in each level and given from the server.

Every robot as a number of fields:

  • id
  • pos
  • speed
  • src
  • dest

id and speed are given from the server.

pos- the first position for the robot is set in the autosetrobots funtion in simpleGameClient class.

src- set in the begining in the autosetrobots function, while the game is running the src is set depend on the path of the robot.

dest - while the robot is on the move the dest is set for is final destination, when the robot arrives to is dest the dest itself change to -1, which means the robot currently has no destination.