package test;

import com.apress.framework.core.Application;
import com.apress.framework.core.Bootstrap;
import com.apress.framework.objecttypes.EVT;
import com.apress.framework.objecttypes.Event;
import javax.microedition.midlet.*;

public class TestMidlet extends MIDlet
{
    public void startApp()
    {
        Bootstrap.boot(this, 1500);
    
        Player player1 = new Player(EVT.TEST.PING, EVT.TEST.PONG, "PING!");
        Player player2 = new Player(EVT.TEST.PONG, EVT.TEST.PING, "PONG!");
    
        Application.getMainEventController().registerListener(player1);
        Application.getMainEventController().registerListener(player2);
    
        // Pierwsze zdarzenie
        Event evt = new Event(EVT.CONTEXT.TEST, EVT.TEST.PING, this);
        Application.getMainEventController().queueEvent(evt);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
