Class GameManager
The GameManager singleton handles game execution lifecycle.
Inheritance
Inherited Members
Namespace: osrlib.Controllers
Assembly: osrlib.Core.dll
Syntax
public class GameManager
Remarks
The GameManager singleton should be accessed only via the Instance property.
Properties
| Improve this Doc View SourceActiveAdventure
Gets the current Adventure for the game.
Declaration
public Adventure ActiveAdventure { get; }
Property Value
Type | Description |
---|---|
Adventure |
Instance
Gets the singleton instance of the GameManager.
Declaration
public static GameManager Instance { get; }
Property Value
Type | Description |
---|---|
GameManager |
Methods
| Improve this Doc View SourceLoadAdventure(SaveType, String)
Loads the specified Adventure into the GameManager, and sets it as the ActiveAdventure.
Declaration
public bool LoadAdventure(SaveType saveType, string path)
Parameters
Type | Name | Description |
---|---|---|
SaveType | saveType | The type of save/load operation. |
System.String | path | The path or URL to the Adventure to load. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the operation was successful. |
SaveActiveAdventure(SaveType, String)
Saves the ActiveAdventure to the specified storage location.
Declaration
public bool SaveActiveAdventure(SaveType saveType, string path)
Parameters
Type | Name | Description |
---|---|---|
SaveType | saveType | The type of save/load operation. |
System.String | path | The path or URL to which to save the Adventure. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the save operation was successful. |
SetActiveAdventure(Adventure)
Sets the active Adventure for the game session.
Declaration
public void SetActiveAdventure(Adventure adventure)
Parameters
Type | Name | Description |
---|---|---|
Adventure | adventure | The Adventure to set for the current game session. |
StartAdventure()
Starts the active Adventure.
Declaration
public void StartAdventure()
Events
| Improve this Doc View SourceAdventureLoaded
Event raised when the ActiveAdventure is loaded.
Declaration
public event EventHandler AdventureLoaded
Event Type
Type | Description |
---|---|
System.EventHandler |
AdventureSaved
Event raised when the ActiveAdventure is saved.
Declaration
public event EventHandler AdventureSaved
Event Type
Type | Description |
---|---|
System.EventHandler |
AdventureStarted
Event raised when the ActiveAdventure is started.
Declaration
public event EventHandler AdventureStarted
Event Type
Type | Description |
---|---|
System.EventHandler |