/***********************************************************************

GECCO, a platform for command and control gaming

Copyright (C) 2001 Henrik Bäärnhielm, Andreas Enblom, Niklas
Hallenfur, Karl Hasselström, Henrik Hägerström, Oskar Linde, Jing Fu
Zi and Jon Åslund

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.

***********************************************************************/

package gecco.server.core;

/**
 *  Represents a definition of an Action, as defined in the configuration files.
 *
 * @author     Henrik Bäärnhielm, Karl Hasselström, Henrik Hägerström.
 * @created    April 30, 2001
 */
public class ActionDefinition {

    /**
     *  The name of the action.
     */
    public String name;
    /**
     *  The class that implements the action.
     */
    public Class actionClass;
    /**
     *  Description of the action. This is the string that the client sees.
     */
    public String description;
    /**
     *  The argument type of the action. Can be void, point or unit.
     */
    public String argumentType;
    /**
     *  Flag to indicate if the action is normal or instantaneous.
     */
    public boolean isInstantaneous;


    /**
     *  Constructor for the ActionDefinition object
     *
     * @param  _name          The name of the action.
     * @param  _actionClass   The class of the action.
     * @param  _description   The description of the action.
     * @param  _argumentType  The argument type of the action.
     */
    public ActionDefinition(String _name, Class _actionClass, String _description, String _argumentType) {
        name = _name;
        actionClass = _actionClass;
        description = _description;
        argumentType = _argumentType;
        if (argumentType.equals("INSTANT_VOID") ||
                argumentType.equals("INSTANT_POINT") ||
                argumentType.equals("INSTANT_UNIT")) {
            isInstantaneous = true;
        } else {
            isInstantaneous = false;
        }
    }
}

