/*
Tiamat - a role-playing game framework
Event.java - An event triggered by the game or player
    
 Copyright  (C) 2005 Hugues Johnson
 
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 com.huguesjohnson.tiamat;

/** Event - An event triggered by the game or player. 
 * @author Hugues Johnson
 */
public class Event implements Cloneable{
    
/* begin public properties */    
    //the action to perform
    private String action;
    /** Returns the action to perform.
     * return The action to perform.
     */
    public String getAction(){
        return(this.action);
    }
    /** Sets the action to perform.
     * @param action The action to perform.
     */
    public void setAction(String action){
        this.action=new String(action);
    }
    //the parameters for this action
    private StringTable parameters;
    /** Returns the parameters for the action.
     * @return A StringTable containing the parameters for the action.
     */
    public StringTable getParameters(){
        return(this.parameters);
    }
    /** Sets the parameters for the action.
     * @param parameters The new parameters for the action.
     */
    public void setParameters(StringTable parameters){
        this.parameters=parameters;
    }
/* end public properties */    

/* begin constructors */
    /** Create a new event with no parameters. 
     * @param action The action to perform.
     */
    public Event(String action){
        this.setAction(action);
        this.parameters=new StringTable();
    }
    /** Create a new event with no parameters. 
     * @param action The action to perform.
     */
    public Event(String action,StringTable parameters){
        this.setAction(action);
        this.setParameters(parameters);
    }
/* end constructors */    
    
    public Event clone(){
		Event clone=new Event(new String(this.getAction()));
		clone.setParameters(this.parameters.clone());
		return(clone);
	}    
}