package worldoffri;

/**
 * This class is part of the "World of Zuul" application. 
 * "World of Zuul" is a very simple, text based adventure game.  
 * 
 * This class holds an enumeration of all command words known to the game.
 * It is used to recognise commands as they are typed in.
 *
 * @author  Michael Kolling and David J. Barnes
 * @version 2006.03.30
 */

public class NazvyPrikazov
{
    // a constant array that holds all valid command words
    private static final String[] aPlatnePrikazy = {
        "chod", "ukonci", "pomoc", "zodvihni", "poloz", "profil"
    };

    /**
     * Constructor - initialise the command words.
     */
    public NazvyPrikazov()
    {
        // nothing to do at the moment...
    }

    /**
     * Check whether a given String is a valid command word. 
     * @return true if a given string is a valid command,
     * false if it isn't.
     */
    public boolean jePrikaz(String paNazov)
    {
        for(int i = 0; i < aPlatnePrikazy.length; i++) {
            if(aPlatnePrikazy[i].equals(paNazov))
                return true;
        }
        // if we get here, the string was not found in the commands
        return false;
    }
}
