gecco.client
Class Position

java.lang.Object
  |
  +--gecco.client.Position

public class Position
extends Object

Represents the position of a Piece. The coordinates are given as doubles.

Author:
Andreas Enblom

Field Summary
 double x
          Description of the Field
 double y
          Description of the Field
 
Constructor Summary
Position()
          Initilizes a position at the origin (0,0);
Position(double x, double y)
          Constructor for the Position object
Position(Position p)
          Initilizes a position with the same coordinates as the given position object.
 
Method Summary
 boolean equals(Position p)
          Description of the Method
 double getX()
          Gets the X attribute of the Position object
 double getY()
          Gets the Y attribute of the Position object
 void setX(double x)
          Sets the X attribute of the Position object
 void setY(double y)
          Sets the Y attribute of the Position object
 void translate(double dx, double dy)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double x
Description of the Field

y

public double y
Description of the Field
Constructor Detail

Position

public Position()
Initilizes a position at the origin (0,0);

Position

public Position(Position p)
Initilizes a position with the same coordinates as the given position object.
Parameters:
p - Description of Parameter

Position

public Position(double x,
                double y)
Constructor for the Position object
Parameters:
x - Description of Parameter
y - Description of Parameter
Method Detail

setX

public void setX(double x)
Sets the X attribute of the Position object
Parameters:
x - The new X value

setY

public void setY(double y)
Sets the Y attribute of the Position object
Parameters:
y - The new Y value

getX

public double getX()
Gets the X attribute of the Position object
Returns:
The X value

getY

public double getY()
Gets the Y attribute of the Position object
Returns:
The Y value

translate

public void translate(double dx,
                      double dy)
Description of the Method
Parameters:
dx - Description of Parameter
dy - Description of Parameter

equals

public boolean equals(Position p)
Description of the Method
Parameters:
p - Description of Parameter
Returns:
Description of the Returned Value