package app.mar.game.scheduler;


import app.mar.activities.ChallengeDriver;
import app.mar.game.Event;
import app.mar.game.Game;

public class EventTask extends Task {
    protected Event mEvent;

    public EventTask(Event e) {
        super(TASK_EVENT);
        mEvent = e;
    }


    public String toString()
    {
        return "[ Event, '"+mEvent.getMethod()+"' ]";
    }

    @Override
    public int exec(Scheduler s, ChallengeDriver cd, Game g) {
        mEvent.exec(cd, g);
        cd.save();
        return s.schedule(cd, g);
    }

    public Event getEvent() {
        return mEvent;
    }
}
