Class Position


  • public class Position
    extends java.lang.Object
    This class represents a position within the board in pixel coordinates
    Author:
    dmlux
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double x
      X coordinate
      private double y
      Y coordinate
    • Constructor Summary

      Constructors 
      Constructor Description
      Position​(double x, double y)
      The constructor needs a x and y coordinate to be called
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getX()
      Getter for the x-coordinate
      double getY()
      Getter for y-coordinate
      void setX​(double x)
      Setter for the x-coordinate
      void setY​(double y)
      Setter for the y-coordinate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        private double x
        X coordinate
      • y

        private double y
        Y coordinate
    • Constructor Detail

      • Position

        public Position​(double x,
                        double y)
        The constructor needs a x and y coordinate to be called
        Parameters:
        x - The x position of the object on the board
        y - The y position of the object on the board
    • Method Detail

      • getX

        public double getX()
        Getter for the x-coordinate
        Returns:
        x The x value of this position
      • setX

        public void setX​(double x)
        Setter for the x-coordinate
        Parameters:
        x - The new x-coordinate
      • getY

        public double getY()
        Getter for y-coordinate
        Returns:
        y The y value of the position
      • setY

        public void setY​(double y)
        Setter for the y-coordinate
        Parameters:
        y - The new y-coordinate