Class Movement

java.lang.Object
blockly_robot.robot.logic.log.Action
blockly_robot.robot.logic.log.Movement

public class Movement extends Action
Represents a movement made by a robot.
  • Constructor Details

    • Movement

      public Movement(String name, VirtualRobot robot)
      Constructs a Movement object with the specified name and robot.
      Parameters:
      name - the name of the movement
      robot - the virtual robot
  • Method Details

    • getTo

      public DirectionalCoords getTo()
    • setTo

      public Movement setTo()
      Sets the 'to' location of the movement and calculates the relocation and rotation values.
      Returns:
      the updated Movement object
    • setTo

      public Movement setTo(int toRow, int toCol, Compass toDir)
    • hasNext

      public boolean hasNext()
    • setNext

      public void setNext(Movement next)
    • getNext

      public Movement getNext()
    • getRotation

      public int getRotation()
    • setTo

      public Movement setTo(int toRow, int toCol)
    • setTo

      public Movement setTo(Coords to)
    • isRelocated

      public boolean isRelocated()
    • setError

      public Movement setError(ErrorMessages error)
      Overrides:
      setError in class Action
    • toString

      public String toString()
      Returns a string representation of the Movement object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the Movement object
    • getName

      public String getName()
      Overrides:
      getName in class Action