/*
 *  Agent's ALLL abstract action class
 *
 *  2004 - 2011 Frantisek Zboril jr.
 *  Faculty of Information Technology
 *  zborilf@fit.vutbr.cz
 *  http://www.fit.vutbr.cz/~zborilf
 *
 * (C) Brno University of Technology
 * Freeware licence VUT v Brně
 * https://wis.fit.vutbr.cz/FIT/db/dir.php/dr/VZ2007/externiInformace/softwareNaWebu/Priloha2_rozh23.pdf

 */

package jTMass.core.jAMass.jActions;
import jTMass.core.jAMass.TAgent;
import jTMass.core.jALLL.jTObjects.TList;
import jTMass.core.jALLL.jTObjects.TObject;


public abstract class TAction extends TObject {
	
    TList PList;

    // ===== READERS, WRITER =====

    public void setList(TList list){
        PList=list;
    }
	
    public abstract String getActionName();

    @Override
    public abstract String getContent();

    public String getParamsS(){
        if(PList!=null)
            return(PList.getContent());
        else
            return("");
    }

    // ===== REGISTERS =====

    @Override
    public TObject substituteRegisters(TAgent agent){
        if(PList!=null)
                PList=(TList)PList.substituteRegisters(agent);
	return(this);
    }

    @Override
    public void matureRegisters(){
        if(PList!=null)
            PList.matureRegisters();
    }

    // ===== ACTION EXECUTION =====

    public TObject execute(TAgent agent){
        this.substituteRegisters(agent); // just substitute registers
	return(null);
    }

    // ===== CONSTRUCTOR =====

    public TAction(int type){
	super(type);
    }
	
}
