Class MouseProfileStore


  • @Singleton
    public class MouseProfileStore
    extends java.lang.Object
    Loads and saves movement profiles as one JSON file per profile.

    Profiles live under ~/.openosrs/mouse-profiles. One file each, rather than a single combined document, so that a profile can be copied to another machine, kept in version control or hand-edited without risking the rest. Every load is sanitised: these files are user-editable and the trainer writes them, so nothing read from disk is trusted.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_PROFILE  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean delete​(java.lang.String name)  
      java.nio.file.Path getDirectory()  
      void invalidate()
      Drop cached profiles so the next load re-reads from disk.
      java.util.List<java.lang.String> list()  
      MouseProfile load​(java.lang.String name)
      Load a profile by name, falling back to built-in defaults.
      void save​(MouseProfile profile)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • MouseProfileStore

        public MouseProfileStore()
      • MouseProfileStore

        public MouseProfileStore​(java.nio.file.Path directory)
    • Method Detail

      • getDirectory

        public java.nio.file.Path getDirectory()
      • load

        public MouseProfile load​(java.lang.String name)
        Load a profile by name, falling back to built-in defaults.

        A missing file is not an error: a fresh install has no profiles and should still move sensibly. A corrupt file is logged once and then also falls back, because refusing to move at all is a worse outcome than moving with defaults.

      • list

        public java.util.List<java.lang.String> list()
      • delete

        public boolean delete​(java.lang.String name)
      • invalidate

        public void invalidate()
        Drop cached profiles so the next load re-reads from disk.