Class DynamicMod.Builder
- Namespace
- MonkeyLoader.Meta
- Assembly
- MonkeyLoader.dll
Use this to construct a DynamicMod.
public sealed class DynamicMod.Builder
- Inheritance
-
DynamicMod.Builder
- Inherited Members
Constructors
Builder(string, Version)
Creates a new DynamicMod.Builder instance with the given unique identifier and an empty Zio.FileSystems.MemoryFileSystem.
public Builder(string id, Version version)
Parameters
Builder(string, Version, IFileSystem)
Creates a new DynamicMod.Builder instance with the given unique identifier and Zio.IFileSystem.
public Builder(string id, Version version, IFileSystem fileSystem)
Parameters
idstringThe unique id for this mod.
versionVersionThe version for this mod.
fileSystemIFileSystemThe filesystem for this mod.
Properties
Authors
Gets or sets the names of the authors of this mod.
public IEnumerable<string> Authors { get; set; }
Property Value
Description
Gets or sets the description of this mod.
public string Description { get; set; }
Property Value
EarlyMonkeys
Gets or sets the types of the IEarlyMonkeys that should be part of this mod.
public IEnumerable<Type> EarlyMonkeys { get; }
Property Value
FileSystem
Gets the file system for the mod.
All files within will be considered content.
public IFileSystem FileSystem { get; }
Property Value
- IFileSystem
IconPath
Gets or sets the path to the mod's icon inside the mod's FileSystem.
null if it wasn't given or doesn't exist.
public UPath? IconPath { get; set; }
Property Value
- UPath?
IconUrl
Gets or sets the Url to the mod's icon on the web.
null if it wasn't given or was invalid.
public Uri? IconUrl { get; set; }
Property Value
Id
Gets the unique identifier of this mod.
public string Id { get; }
Property Value
IsGamePack
Gets or sets whether this mod is a game pack.
public bool IsGamePack { get; set; }
Property Value
Remarks
Default: false
Location
Gets or sets the absolute path to this mod's file. May be null if the mod only exists in memory.
public string? Location { get; set; }
Property Value
Monkeys
Gets or sets the types of the IMonkeys that should be part of this mod.
public IEnumerable<Type> Monkeys { get; }
Property Value
ProjectUrl
Gets or sets the Url to this mod's project website.
null if it wasn't given or was invalid.
public Uri? ProjectUrl { get; set; }
Property Value
ReleaseNotes
Gets or sets the release notes for this mod's version.
public string? ReleaseNotes { get; set; }
Property Value
Tags
Gets or sets the tags of this mod.
public IEnumerable<string> Tags { get; set; }
Property Value
Title
Gets or sets the nice identifier of this mod.
public string? Title { get; set; }
Property Value
Version
Gets this mod's version.
public Version Version { get; }
Property Value
Methods
AddEarlyMonkey<TEarlyMonkey>()
Add an IEarlyMonkey type to the Monkeys.
public void AddEarlyMonkey<TEarlyMonkey>() where TEarlyMonkey : EarlyMonkey<TEarlyMonkey>, new()
Type Parameters
TEarlyMonkeyThe type of the early monkey to add.
AddEarlyMonkeys(IEnumerable<Type>)
Adds the given IEarlyMonkey-implementing Types to EarlyMonkeys.
public void AddEarlyMonkeys(IEnumerable<Type> earlyMonkeyTypes)
Parameters
earlyMonkeyTypesIEnumerable<Type>The types to add.
AddMonkey<TMonkey>()
public void AddMonkey<TMonkey>() where TMonkey : Monkey<TMonkey>, new()
Type Parameters
TMonkeyThe type of the monkey to add.
AddMonkeys(IEnumerable<Type>)
public void AddMonkeys(IEnumerable<Type> monkeyTypes)
Parameters
monkeyTypesIEnumerable<Type>The types to add.
CreateAndRunFor(MonkeyLoader)
Constructs a DynamicMod from this builder, associating it with the given loader and running it immediately. Must only be used once.
public DynamicMod CreateAndRunFor(MonkeyLoader loader)
Parameters
loaderMonkeyLoaderThe loader to add the mod to and run it with.
Returns
- DynamicMod
The DynamicMod constructed from this builder.
Exceptions
- InvalidOperationException
When this method is called more than once.
CreateFor(MonkeyLoader)
Constructs a DynamicMod from this builder and associates it with the given loader.
Must only be used once.
public DynamicMod CreateFor(MonkeyLoader loader)
Parameters
loaderMonkeyLoaderThe loader to add the mod to.
Returns
- DynamicMod
The DynamicMod constructed from this builder.
Exceptions
- InvalidOperationException
When this method is called more than once.