Class GameModule
Class representing the entry point of a Socially Distant module.
Assembly: SociallyDistant.Framework.dll
Syntax
public abstract class GameModule
Properties
Context
Declaration
public IGameContext Context { get; }
Property Value
IsCoreModule
Gets a value indicating whether this module is a core module. If true, then the user can't enable or disable this module during runtime.
Declaration
public abstract bool IsCoreModule { get; }
Property Value
IsInitialized
Gets a value indicating whether this module is currently initialized.
Declaration
public bool IsInitialized { get; }
Property Value
ModuleId
Gets a unique module ID for this module. Please use reverse domain name notation.
Declaration
public abstract string ModuleId { get; }
Property Value
RequiredModules
Gets a list of module IDs this module requires.
Declaration
public virtual IEnumerable<string> RequiredModules { get; }
Property Value
Methods
AfterContentLoad()
Called every time the game's Content Manager reloads.
Declaration
public virtual void AfterContentLoad()
Initialize(IGameContext)
Initializes the module if it is not already initialized.
Declaration
public Task Initialize(IGameContext context)
Parameters
Returns
OnGameModeChanged(GameMode)
Called when the current game mode changes. Use this to perform actions during certain game states.
Declaration
public virtual void OnGameModeChanged(GameMode gameMode)
Parameters
Type |
Name |
Description |
GameMode |
gameMode |
The new game mode
|
OnInitialize()
Declaration
protected abstract Task OnInitialize()
Returns
OnShutdown()
Declaration
protected abstract Task OnShutdown()
Returns
Shutdown()
Declaration
Returns