Class WarfareModule
public sealed class WarfareModule
- Inheritance
-
WarfareModule
- Inherited Members
Fields
Season
The current season.
public static readonly int Season
Field Value
Properties
Configuration
System Config.yml. Stores information not directly related to gameplay.
public IConfiguration Configuration { get; }
Property Value
EventDispatcher
Static instance of the event dispatcher singleton for harmony patches to access it.
public static EventDispatcher EventDispatcher { get; }
Property Value
Remarks
Do not use unless in a patch.
FileProvider
Handles tracking file changing and configuration for any files in Servers/[Server ID]/Warfare/.
public PhysicalFileProvider FileProvider { get; }
Property Value
GlobalLogger
A global logger that can be used from patches mainly.
public ILogger GlobalLogger { get; }
Property Value
HomeDirectory
A path to the top-level 'Warfare' folder.
public string HomeDirectory { get; }
Property Value
IsActive
If Uncreated.Warfare is loaded as a module instead of as a library.
public static bool IsActive { get; }
Property Value
ScopedProvider
Game-specific service provider. If a game is not active, this will throw an error.
public ILifetimeScope ScopedProvider { get; }
Property Value
- ILifetimeScope
Exceptions
ServiceProvider
Global service provider. Gamemodes have their own scoped service providers and should be used instead.
public IContainer ServiceProvider { get; }
Property Value
- IContainer
Singleton
Static instance of this module singleton for harmony patches to access it.
public static WarfareModule Singleton { get; }
Property Value
Remarks
Do not use unless in a patch.
UnloadToken
Token that will cancel when the module shuts down.
public CancellationToken UnloadToken { get; }
Property Value
Methods
CreateActivitySource()
public static ActivitySource CreateActivitySource()
Returns
GetActiveLayout()
Get the active layout.
public Layout GetActiveLayout()
Returns
Exceptions
- InvalidOperationException
There is not an active layout.
IsLayoutActive()
Check if there is an active layout.
public bool IsLayoutActive()
Returns
ShutdownAsync(string, CancellationToken)
public UniTask ShutdownAsync(string reason, CancellationToken token = default)
Parameters
reasonstringtokenCancellationToken
Returns
- UniTask
Events
LayoutStarted
public event Action? LayoutStarted