aigames.soccer
Class Move

java.lang.Object
  extended byaigames.soccer.Move

public class Move
extends java.lang.Object

This class represents single move (i.e. sequence of steps) in soccer game.

Version:
$Id: Move.java,v 1.6 2004/05/08 21:55:29 mwerla Exp $

Field Summary
static java.lang.Integer E
          Step east.
static java.lang.Integer N
          Step north.
static java.lang.Integer NE
          Step north-east.
static java.lang.Integer NW
          Step north-west.
static java.lang.Integer S
          Step south.
static java.lang.Integer SE
          Step south-east.
static java.lang.Integer SW
          Step south-west.
static java.lang.Integer W
          Step west.
 
Constructor Summary
Move(int[] steps)
          Creates move with steps passed as parameter.
Move(java.lang.Integer[] steps)
          Creates move with steps passed as parameter.
 
Method Summary
 void addStep(int step)
          Adds single step to move instance.
 void addStep(java.lang.Integer step)
          Adds single step to move instance.
 void addStepSequence(int[] steps)
          Adds sequnece of steps to move instance.
 void addStepSequence(java.lang.Integer[] steps)
          Adds sequnece of steps to move instance.
 java.util.Collection getSteps()
          Returns Collection of steps in this move instance.
static int[] getTranslation(java.lang.Integer direction)
          Returns geometric translation corresponding to given direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

N

public static final java.lang.Integer N
Step north.


NE

public static final java.lang.Integer NE
Step north-east.


E

public static final java.lang.Integer E
Step east.


SE

public static final java.lang.Integer SE
Step south-east.


S

public static final java.lang.Integer S
Step south.


SW

public static final java.lang.Integer SW
Step south-west.


W

public static final java.lang.Integer W
Step west.


NW

public static final java.lang.Integer NW
Step north-west.

Constructor Detail

Move

public Move(int[] steps)
     throws InvalidMoveException
Creates move with steps passed as parameter.

Parameters:
steps - Array of steps that move consists of.
Throws:
InvalidMoveException - Thrown when steps are invalid.

Move

public Move(java.lang.Integer[] steps)
     throws InvalidMoveException
Creates move with steps passed as parameter.

Parameters:
steps - Array of steps that move consists of.
Throws:
InvalidMoveException - Thrown when steps are invalid.
Method Detail

getTranslation

public static int[] getTranslation(java.lang.Integer direction)
Returns geometric translation corresponding to given direction.

Parameters:
direction - Step direction.
Returns:
geometric translation corresponding to given direction.

addStepSequence

public void addStepSequence(java.lang.Integer[] steps)
                     throws InvalidMoveException
Adds sequnece of steps to move instance.

Parameters:
steps - Array of steps to add.
Throws:
InvalidMoveException - Thrown when steps are invalid.

addStep

public void addStep(java.lang.Integer step)
             throws InvalidMoveException
Adds single step to move instance.

Parameters:
step - Step to add.
Throws:
InvalidMoveException - Thrown when step is invalid.

addStep

public void addStep(int step)
             throws InvalidMoveException
Adds single step to move instance.

Parameters:
step - Step to add.
Throws:
InvalidMoveException - Thrown when step is invalid.

addStepSequence

public void addStepSequence(int[] steps)
                     throws InvalidMoveException
Adds sequnece of steps to move instance.

Parameters:
steps - Array of steps to add.
Throws:
InvalidMoveException - Thrown when steps are invalid.

getSteps

public java.util.Collection getSteps()
Returns Collection of steps in this move instance.

Returns:
Collection of steps in this move instance.


Copyright © 2001-2004 MoMaT & MWe Team. All Rights Reserved.