WKLib 0.2.3
A modding library for White Knuckle
Loading...
Searching...
No Matches
WKLib.API.Gamemodes.GamemodeBuilder Class Reference

A fluent builder class for creating and configuring an M_Gamemode instance.
It allows setting various properties of a gamemode such as regions, name, intro text, and gameplay flags in a chainable manner before finally building the M_Gamemode object. More...

+ Collaboration diagram for WKLib.API.Gamemodes.GamemodeBuilder:

Public Member Functions

GamemodeBuilder WithRegions (List< M_Region > regions)
 Sets the list of regions for this gamemode.
 
GamemodeBuilder WithName (string modeName)
 Sets the displayed name of the gamemode (which can also serves as the capsule name)
 
GamemodeBuilder WithIntroText (string introText)
 Sets the intro text for the gamemode
This text is shown when loaded into the gamemode.
 
GamemodeBuilder IsEndless (bool isEndless)
 Sets whether the gamemode should be endless.
 
GamemodeBuilder HasPerks (bool hasPerks)
 Sets whether perks are available in this gamemode.
 
GamemodeBuilder HasRevives (bool hasRevives)
 Sets whether revives are available in this gamemode.
 
GamemodeBuilder WithCapsuleSprite (Sprite sprite)
 Provides a Sprite to use for the gamemode's capsule art.
 
GamemodeBuilder WithScreenArt (Sprite sprite)
 Provides a Sprite to use for the gamemode's screen art.
 
GamemodeBuilder WithStartItems (List< M_Gamemode.SpawnItem > spawnItems)
 Sets the list of items players will start with when entering this gamemode.
 
GamemodeBuilder WithGameType (string gameType)
 Sets the game type for the gamemode based on a string input.
 
M_Gamemode Build ()
 Constructs and returns a new M_Gamemode instance based on the properties configured in this builder.
 

Detailed Description

A fluent builder class for creating and configuring an M_Gamemode instance.
It allows setting various properties of a gamemode such as regions, name, intro text, and gameplay flags in a chainable manner before finally building the M_Gamemode object.

Definition at line 14 of file GamemodeBuilder.cs.

Member Function Documentation

◆ Build()

M_Gamemode WKLib.API.Gamemodes.GamemodeBuilder.Build ( )

Constructs and returns a new M_Gamemode instance based on the properties configured in this builder.

Returns
A new M_Gamemode object populated with the specified settings

Definition at line 155 of file GamemodeBuilder.cs.

◆ HasPerks()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.HasPerks ( bool hasPerks)

Sets whether perks are available in this gamemode.

Parameters
hasPerksA boolean value indicating if perks are enabled
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 77 of file GamemodeBuilder.cs.

◆ HasRevives()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.HasRevives ( bool hasRevives)

Sets whether revives are available in this gamemode.

Parameters
hasRevivesA boolean value indicating if revives are enabled
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 88 of file GamemodeBuilder.cs.

◆ IsEndless()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.IsEndless ( bool isEndless)

Sets whether the gamemode should be endless.

Parameters
isEndlessA boolean value indicating if the gamemode is endless
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 66 of file GamemodeBuilder.cs.

◆ WithCapsuleSprite()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.WithCapsuleSprite ( Sprite sprite)

Provides a Sprite to use for the gamemode's capsule art.

Parameters
spriteThe Sprite to set as the capsule art
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 99 of file GamemodeBuilder.cs.

◆ WithGameType()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.WithGameType ( string gameType)

Sets the game type for the gamemode based on a string input.

Parameters
gameTypeA string representing the desired game type (e.g., "endless", "standard", "playlist", "playlist-shuffle", "single")
Returns
The current GamemodeBuilder instance for fluent chaining

The string input is case-insensitive and mapped to the corresponding M_Gamemode.GameType enum value
If an unknown string is provided, the existing _gameType value is retained (auto-chosen)

Definition at line 136 of file GamemodeBuilder.cs.

◆ WithIntroText()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.WithIntroText ( string introText)

Sets the intro text for the gamemode
This text is shown when loaded into the gamemode.

Parameters
introTextThe introductory text
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 55 of file GamemodeBuilder.cs.

◆ WithName()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.WithName ( string modeName)

Sets the displayed name of the gamemode (which can also serves as the capsule name)

Parameters
modeNameThe desired name for the gamemode
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 43 of file GamemodeBuilder.cs.

◆ WithRegions()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.WithRegions ( List< M_Region > regions)

Sets the list of regions for this gamemode.

Parameters
regionsA List<T> of M_Region instances to be used in the gamemode
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 32 of file GamemodeBuilder.cs.

◆ WithScreenArt()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.WithScreenArt ( Sprite sprite)

Provides a Sprite to use for the gamemode's screen art.

Parameters
spriteThe Sprite to set as the screen art
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 110 of file GamemodeBuilder.cs.

◆ WithStartItems()

GamemodeBuilder WKLib.API.Gamemodes.GamemodeBuilder.WithStartItems ( List< M_Gamemode.SpawnItem > spawnItems)

Sets the list of items players will start with when entering this gamemode.

Parameters
spawnItemsA List<T> of M_Gamemode.SpawnItem defining the initial inventory
Returns
The current GamemodeBuilder instance for fluent chaining

Definition at line 121 of file GamemodeBuilder.cs.


The documentation for this class was generated from the following file: