package app.model;

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

import app.settings.SettingsProvider;
import javafx.scene.Scene;

/**
 * Data model of the application.
 * 
 * Contains a static reference to state that has to be accessed by multiple
 * pieces in the application, including the state like primary scene.
 */
public class Model {
  private static boolean fileIsSaved;
  private static Optional<Path> activeFilePath;
  private static Optional<Path> currentProjectPath;
  private static ProgrammingLanguage currentProgrammingLanguage;
  private static String theme;
  private static Scene scene;
  private static SettingsProvider settings;

  public static Optional<Path> getActiveFilePath() {
    return activeFilePath;
  }

  public static void setActiveFilePath(Optional<Path> path) {
    Model.activeFilePath = path;
  }

  public static Optional<Path> getProjectPath() {
    return currentProjectPath;
  }

  public static void setProjectPath(Optional<Path> path) {
    Model.currentProjectPath = path;
  }

  public static ProgrammingLanguage getLanguage() {
    return currentProgrammingLanguage;
  }

  public static Scene getScene() {
    return scene;
  }

  public static String getTheme() {
    return theme;
  }

  public static boolean getFileIsSaved() {
    return fileIsSaved;
  }

  public static SettingsProvider getSettingsProvider() {
    return settings;
  }

  public static void setTheme(String theme) {
    Model.theme = theme;
  }

  public static void setLanguage(ProgrammingLanguage language) {
    Model.currentProgrammingLanguage = language;
  }

  public static void setScene(Scene scene) {
    Model.scene = scene;
  }

  public static void setFileIsSaved(boolean fileIsSaved) {
    Model.fileIsSaved = fileIsSaved;
  }

  public static void setSettingsProvider(SettingsProvider settings) {
    Model.settings = settings;
  }

}