package de.wwwu.awolf.view.services;

import de.wwwu.awolf.presenter.Presenter;
import de.wwwu.awolf.presenter.data.DataHandler;
import javafx.concurrent.Service;
import javafx.concurrent.Task;

public class DataService extends Service<String> {

    private DataHandler.DataType type;
    private int n;

    public DataService(DataHandler.DataType type, int n) {
        this.type = type;
        this.n = n;
    }

    @Override
    protected Task<String> createTask() {
        return new Task<>() {
            @Override
            protected String call() throws Exception {
                Presenter.getInstance().generateDataset(n, type);
                return "done";
            }
        };
    }
}
