/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.cuni.amis.pogamut.base.communication.translator.tr2;

import cz.cuni.amis.pogamut.base.agent.worldview.IWorldEvent;
import cz.cuni.amis.pogamut.base.communication.translator.IWorldChangeEvent;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author ik
 */
public class Worker {

    List<ChangeEventTranslator> translators = new LinkedList<ChangeEventTranslator>();

    public IWorldEvent[] translate(IWorldChangeEvent evt) {
        ChangeEventTranslator.TranslationPackage pckg = new ChangeEventTranslator.TranslationPackage(null, evt);
        for (ChangeEventTranslator tr : translators) {
            pckg = tr.translate(pckg);
        }
        return pckg.getEvents();
    }
}
