|
JMEditorEnvironment
|
Singleton resource manager class for all SimEnvironment instances. Handles saving and loading, as well as sharing data between environments. More...
#include <SimEnvironment.h>
Public Member Functions | |
| SimResourceManager (SimResourceManager &)=delete | |
| SimResourceManager & | operator= (const SimResourceManager)=delete |
| void | save (JMwindow *window) |
| Saves all SimEnvironment objects in the vector to the stored filepath, or opens a file dialog if the file path is empty. | |
| void | saveAs (JMwindow *window) |
| void | load (JMwindow *window) |
| Opens a file dialog and loads a project from the selected file. | |
| void | save (std::string filepath) |
| void | load (std::string filepath) |
| void | recoverBackup () |
| Loads the backup save file if it exists. | |
| void | saveBackup () |
| Saves a backup file. | |
| void | makeNameUnique (SimObject *obj) |
| Generates a new name for the object if it matches any other objects in any SimEnvironment. | |
| SimObject * | findObject (std::string name) |
| Searches for an object by name in all environments and returns a pointer to it if found, else returns nullptr. | |
| std::vector< SimObject * > | allSimObjects () |
| Returns a vector of pointers to all sim objects in all sim environments. | |
Static Public Member Functions | |
| static SimResourceManager & | getInstance () |
Public Attributes | |
| std::vector< SimEnvironment * > | allEnvironments |
| std::string | projectName = "unsaved project" |
| std::string | infoBarMessage = "" |
| std::string | fileExtension = ".jmeditor" |
Singleton resource manager class for all SimEnvironment instances. Handles saving and loading, as well as sharing data between environments.
| std::string SimResourceManager::fileExtension = ".jmeditor" |
The file extension used when saving and loading. Will only be able to open files with this extension. Only set once for all simEnvironments, as it's in the singleton resource manager. Must start with '.'