Package arc.util

Class Autosaver

java.lang.Object
arc.util.Autosaver

public class Autosaver extends Object
Save periodically the registered Autosaver.Saveables and also when the application exit.
  • Field Details

    • listener

      protected static ApplicationListener listener
    • spacing

      protected static int spacing
    • silent

      public static boolean silent
      Doesn't log a message when starting/stopping the Autosaver or when running an auto save.
      Errors will always be logged.
    • errorHandler

      public static Cons2<Autosaver.Saveable,Throwable> errorHandler
      Called when a save fail.
  • Constructor Details

    • Autosaver

      public Autosaver()
  • Method Details

    • add

      public static void add(Autosaver.Saveable saveable)
      Adds to the normal priority.
    • add

      public static void add(Autosaver.Saveable saveable, Autosaver.SavePriority priority)
    • remove

      public static void remove(Autosaver.Saveable saveable)
    • clear

      public static void clear()
    • clear

      public static void clear(Autosaver.SavePriority priority)
    • has

      public static boolean has(Autosaver.Saveable saveable)
    • has

      public static boolean has(Autosaver.Saveable saveable, Autosaver.SavePriority priority)
    • priorityOf

      public static Autosaver.SavePriority priorityOf(Autosaver.Saveable saveable)
    • saveNeeded

      public static boolean saveNeeded()
    • save

      public static boolean save()
      Save all registered things now (only if modified). Errors are ignored and just printed.
    • start

      public static boolean start()
      Start the auto saver, will also save on application exit.
    • stop

      public static boolean stop()
    • isStarted

      public static boolean isStarted()
    • spacing

      public static int spacing()
    • spacing

      public static void spacing(int spacing)