com.carlosbcruz.pegsolitaire
Class OnlyOnePossibility

java.lang.Object
  extended by 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.
 
Method Summary
 void applied()
           
 int getXfrom()
           
 int getXout()
           
 int getXto()
           
 int getYfrom()
           
 int getYout()
           
 int getYto()
           
 java.lang.String toString()
           
 boolean wasApplied()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 moved
y_from - y coordinate of the element to be moved
x_to - x coordinate of the destination of the element
y_to - y coordinate of the destination of the element
x_out - x coordinate of the element to be removed
y_out - y coordinate of the element to be removed
Method Detail

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