Class SaveGame

java.lang.Object
jme3tools.savegame.SaveGame

public class SaveGame extends Object
Tool for saving Savables as SaveGame entries in a system-dependent way.
  • Method Details

    • saveGame

      public static void saveGame(String gamePath, String dataName, Savable data)
      Saves a savable in a system-dependent way.
      Parameters:
      gamePath - A unique path for this game, e.g. com/mycompany/mygame
      dataName - A unique name for this SaveGame, e.g. "save_001"
      data - The Savable to save
    • saveGame

      public static void saveGame(String gamePath, String dataName, Savable data, JmeSystem.StorageFolderType storageType)
      Saves a savable in a system-dependent way.
      Parameters:
      gamePath - A unique path for this game, e.g. com/mycompany/mygame
      dataName - A unique name for this SaveGame, e.g. "save_001"
      data - The Savable to save
      storageType - The specific type of folder to use to save the data
    • loadGame

      public static Savable loadGame(String gamePath, String dataName)
      Loads a savable that has been saved on this system with saveGame() before.
      Parameters:
      gamePath - A unique path for this game, e.g. com/mycompany/mygame
      dataName - A unique name for this SaveGame, e.g. "save_001"
      Returns:
      The savable that was saved
    • loadGame

      public static Savable loadGame(String gamePath, String dataName, JmeSystem.StorageFolderType storageType)
      Loads a savable that has been saved on this system with saveGame() before.
      Parameters:
      gamePath - A unique path for this game, e.g. com/mycompany/mygame
      dataName - A unique name for this SaveGame, e.g. "save_001"
      storageType - The specific type of folder to use to save the data
      Returns:
      The savable that was saved
    • loadGame

      public static Savable loadGame(String gamePath, String dataName, AssetManager manager)
      Loads a savable that has been saved on this system with saveGame() before.
      Parameters:
      gamePath - A unique path for this game, e.g. com/mycompany/mygame
      dataName - A unique name for this SaveGame, e.g. "save_001"
      manager - Link to an AssetManager if required for loading the data (e.g. models with textures)
      Returns:
      The savable that was saved or null if none was found
    • loadGame

      public static Savable loadGame(String gamePath, String dataName, AssetManager manager, JmeSystem.StorageFolderType storageType)
      Loads a savable that has been saved on this system with saveGame() before.
      Parameters:
      gamePath - A unique path for this game, e.g. com/mycompany/mygame
      dataName - A unique name for this SaveGame, e.g. "save_001"
      manager - Link to an AssetManager if required for loading the data (e.g. models with textures)
      storageType - The specific type of folder to use to save the data
      Returns:
      The savable that was saved or null if none was found