net.sf.magicproject.action
Class ActionFactory

java.lang.Object
  extended by net.sf.magicproject.action.ActionFactory

public final class ActionFactory
extends java.lang.Object

Since:
0.85
Author:
Fabrice Daugan

Method Summary
static Test getConstraints(MAction[] cost, Test constraintTest)
          Return the constraints to make usable the specified actions list.
static void init(java.io.InputStream inputFile)
          Initialize pictures and constraints associted to actions.
static MAction readAction(java.io.InputStream inputFile, Modifier modifier)
          Read and return the next action from specified inputFile
static MAction[] readActionList(java.io.InputStream inputFile, Modifier modifier)
          Read a list a actions from the given input stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(java.io.InputStream inputFile)
                 throws java.io.IOException
Initialize pictures and constraints associted to actions.

Parameters:
inputFile - file containing this action
Throws:
java.io.IOException - If some other I/O error occurs

readActionList

public static MAction[] readActionList(java.io.InputStream inputFile,
                                       Modifier modifier)
                                throws java.io.IOException
Read a list a actions from the given input stream.

Parameters:
inputFile - the stream used to create list of actions.
modifier - the optional modifier containing the action list.
Returns:
list of actions read from the given stream.
Throws:
java.io.IOException - If some other I/O error occurs

getConstraints

public static Test getConstraints(MAction[] cost,
                                  Test constraintTest)
Return the constraints to make usable the specified actions list.

Parameters:
cost - is the actions list
constraintTest - is the existing constrains
Returns:
the constraints to make usable the specified actions list.

readAction

public static MAction readAction(java.io.InputStream inputFile,
                                 Modifier modifier)
                          throws java.io.IOException
Read and return the next action from specified inputFile

Parameters:
inputFile - the input stream where action will be read.
modifier - the modifier that would be used with actions that need it. Can be null.
Returns:
the next action read into of specified inputFile
Throws:
java.io.IOException - If some other I/O error occurs


Copyright © 2003-2007 Magic-Project. All Rights Reserved.