package p.studio.projects;

import java.nio.file.Path;
import java.util.Objects;

public final class ProjectStudioPaths {
    private static final String STUDIO_DIR = ".studio";
    private static final String ACTIVITIES_FILE = "activities.json";
    private static final String SETUP_FILE = "setup.json";
    private static final String STATE_FILE = "state.json";

    private ProjectStudioPaths() {
    }

    public static Path studioRoot(ProjectReference projectReference) {
        return Objects.requireNonNull(projectReference, "projectReference")
                .rootPath()
                .resolve(STUDIO_DIR)
                .toAbsolutePath()
                .normalize();
    }

    public static Path activitiesPath(ProjectReference projectReference) {
        return studioRoot(projectReference)
                .resolve(ACTIVITIES_FILE)
                .toAbsolutePath()
                .normalize();
    }

    public static Path statePath(ProjectReference projectReference) {
        return studioRoot(projectReference)
                .resolve(STATE_FILE)
                .toAbsolutePath()
                .normalize();
    }

    public static Path setupPath(ProjectReference projectReference) {
        return studioRoot(projectReference)
                .resolve(SETUP_FILE)
                .toAbsolutePath()
                .normalize();
    }
}
