• Home
  • API reference
  • Source code
Show / Hide Table of Contents
  • osrlib.Controllers
    • GameManager
  • osrlib.Core
    • Ability
    • AbilityType
    • Adventure
    • Alignment
    • Being
    • BeingTargetingEventArgs
    • BeingTargetingEventHandler
    • CharacterClass
    • Dungeon
    • Encounter
    • GameAction
    • GameActionEventArgs
    • GameActionEventHandler
    • GamePosition
    • Modifier
    • Party
    • Quest
    • User
    • Weapon
    • WeaponType
  • osrlib.Dice
    • DiceHand
    • DiceRoll
    • DiceRolledEventArgs
    • DiceRolledEventHandler
    • Die
  • osrlib.SaveLoad
    • SaveLoadLocal
    • SaveType
  • osrlib.Tests
    • CoreRulesTests
    • DiceTests
    • PartyGenerator
    • ReadMeTests
    • SaveLoadTests
    • SteppedBattleTests
  • osrlib.Utility
    • Randomizer

Class GameManager

The GameManager singleton handles game execution lifecycle.

Inheritance
System.Object
GameManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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 Source

ActiveAdventure

Gets the current Adventure for the game.

Declaration
public Adventure ActiveAdventure { get; }
Property Value
Type Description
Adventure
| Improve this Doc View Source

Instance

Gets the singleton instance of the GameManager.

Declaration
public static GameManager Instance { get; }
Property Value
Type Description
GameManager

Methods

| Improve this Doc View Source

LoadAdventure(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

StartAdventure()

Starts the active Adventure.

Declaration
public void StartAdventure()

Events

| Improve this Doc View Source

AdventureLoaded

Event raised when the ActiveAdventure is loaded.

Declaration
public event EventHandler AdventureLoaded
Event Type
Type Description
System.EventHandler
| Improve this Doc View Source

AdventureSaved

Event raised when the ActiveAdventure is saved.

Declaration
public event EventHandler AdventureSaved
Event Type
Type Description
System.EventHandler
| Improve this Doc View Source

AdventureStarted

Event raised when the ActiveAdventure is started.

Declaration
public event EventHandler AdventureStarted
Event Type
Type Description
System.EventHandler
  • Improve this Doc
  • View Source
Back to top Generated by DocFX