package org.ntlab.radishforandroidstudio.cactusClient.models;


import java.io.IOException;
import java.util.HashMap;

import org.ntlab.radishforandroidstudio.framework.model3D.Model3D;
import org.ntlab.radishforandroidstudio.framework.model3D.ModelFactory;
import org.ntlab.radishforandroidstudio.framework.model3D.ModelFileFormatException;

public class StageModelManager {
    private static StageModelManager theInstance = null;
    private HashMap<Integer, Model3D> model = new HashMap<>();

    private StageModelManager() {
        /*****************************************************************************************************
        try {
            setStage(0, ModelFactory.loadModel(getClass().getResource("../../konan/konan.stl").getPath()));
            setStage(1, ModelFactory.loadModel(getClass().getResource("../../konan/konan.stl").getPath()));
        } catch (IOException | ModelFileFormatException  e) {
            e.printStackTrace();
        }
        *******************************************************************************************************/
    }

    public static StageModelManager getInstance() {
        if (theInstance == null) {
            theInstance = new StageModelManager();
        }
        return theInstance;
    }

    public void setStage(int key, Model3D model3d) {
        model.put(key, model3d);
    }

    public Model3D getStage(int stageID) {
        return model.get(stageID);
    }

    public int getStageModelCount() {
        return model.size();
    }

}