package app.mar.game.scheduler;

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

public class ResourceTask extends Task {

    protected Resource mResource;

    public ResourceTask(Resource r) {
        super(TASK_RESOURCE);
        mResource =r;
    }


    public String toString()
    {
        return "[ Resource, '"+mResource.getName()+"' ]";
    }

    @Override
    public int exec(Scheduler s, ChallengeDriver cd, Game g) {
        cd.startResource(mResource);
        return TASK_RESOURCE;
    }

    public Resource getResource() {
        return mResource;
    }
}
