package part1;

/**
 * Interface defing the obligations of a PlayerFactory.
 * 
 * The Player factory is used to create the commands and context 
 * of a type of player.
 *
 * By using the AbstractFactory pattern we are able to extend
 * our manufacturing to include other types of Players without
 * too much difficulty.
 *
 * A class that implements PlayerFactory must keep a Map of 
 * commands that it can create, keyed on a String representation
 * of the command, such as "play".
 * 
 * @see PlayerCommand
 * @see PlayerContext
 *
 * @author $Author: cdent $
 *
 * @version $Revision: 1.2 $
 *
 */
public interface PlayerFactory {

    /**
     * Looks up the string a Map of Commands and returns an
     * instance of the command.
     *
     * @param string the name of the command to be created
     * @param context the PlayerContext within which this command 
     *                will operate
     *
     */
    public abstract PlayerCommand makeCommand(String string,
					      PlayerContext context);

    /**
     * Creates and returns a PlayerContext for the player.
     *
     */
    public abstract PlayerContext makeContext();

}
    
