com.carlosbcruz.pegsolitaire
Class OnlyOnePossibility
java.lang.Object
com.carlosbcruz.pegsolitaire.OnlyOnePossibility
- All Implemented Interfaces:
- Possibility
public class OnlyOnePossibility
- extends java.lang.Object
- implements Possibility
Represent one possibility of movement.
- Author:
- Carlos Fernando Bella Cruz - pessoal@carlosbcruz.com
Constructor Summary |
OnlyOnePossibility(int x_from,
int y_from,
int x_to,
int y_to,
int x_out,
int y_out)
Constructor that represent a movement. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OnlyOnePossibility
public OnlyOnePossibility(int x_from,
int y_from,
int x_to,
int y_to,
int x_out,
int y_out)
- Constructor that represent a movement. An element can be moved
from x,y coordinates to x,y coordinates an removing a x,y element
from the board.
- Parameters:
x_from
- x coordinate of the element to be movedy_from
- y coordinate of the element to be movedx_to
- x coordinate of the destination of the elementy_to
- y coordinate of the destination of the elementx_out
- x coordinate of the element to be removedy_out
- y coordinate of the element to be removed
getXfrom
public int getXfrom()
- Returns:
- x coordinate of the element to be moved
getYfrom
public int getYfrom()
- Returns:
- y coordinate of the element to be moved
getXto
public int getXto()
- Returns:
- x coordinate of the destination of the element
getYto
public int getYto()
- Returns:
- y coordinate of the destination of the element
getXout
public int getXout()
- Returns:
- x coordinate of the element to be removed
getYout
public int getYout()
- Returns:
- y coordinate of the element to be removed
applied
public void applied()
- Specified by:
applied
in interface Possibility
wasApplied
public boolean wasApplied()
- Specified by:
wasApplied
in interface Possibility
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object