Class GameState
- Namespace
- SuzerainModdingKit
- Assembly
- SuzerainModdingKit.dll
Static interface for querying and modifying the current state of the game.
public static class GameState
- Inheritance
-
GameState
- Inherited Members
Properties
CurrentStepName
The current step name (eg. "Sordland_Turn_2_Step_3"). Note that the format of step names may vary between story packs. May be null.
[Obsolete("Deprecated in v1.2. Use CurrentStepNum, CurrentTurnNum, and CurrentStoryPackName instead.")]
public static string CurrentStepName { get; }
Property Value
CurrentStepNum
The current step number. May be null.
public static int? CurrentStepNum { get; }
Property Value
- int?
CurrentStoryPackName
The name of the current story pack. May be null.
public static string CurrentStoryPackName { get; }
Property Value
CurrentTurnNum
The current turn number. May be null.
public static int? CurrentTurnNum { get; }
Property Value
- int?
IsGameActive
Is the game active?
public static bool IsGameActive { get; }
Property Value
Methods
AddCustomConversation(string)
[EXPERIMENTAL] Add a custom conversation to the game.
public static bool AddCustomConversation(string name)
Parameters
namestringThe name of the conversation.
Returns
- bool
A boolean indicating whether the operation succeeded or not. Fails if the conversation does not exist in the registry or another error occurs. Succeeds if the conversation was successfully added or it already exists.
Remarks
Experimental: This feature is incomplete and included for public testing. Its behavior and API may change significantly—or it may be removed—in any future release. Do not rely on it in production.
The conversation name must exist in the custom conversations registry. This should be called before adding a conversation story fragment for a custom conversation to the game.
AddCustomReport(CustomReportData)
Add a custom report to the current turn.
public static bool AddCustomReport(CustomReportData customReportData)
Parameters
customReportDataCustomReportDataThe custom report data.
Returns
- bool
A boolean indicating whether the operation succeeded or not.
Exceptions
- ArgumentNullException
Thrown if any required arguments are null.
- InvalidOperationException
Thrown if the game is not active.
AddCustomStoryFragment(CustomStoryFragmentData, AddStoryFragmentOptions)
Add a custom story fragment to the current step.
public static bool AddCustomStoryFragment(CustomStoryFragmentData customStoryFragmentData, AddStoryFragmentOptions options = null)
Parameters
customStoryFragmentDataCustomStoryFragmentDataThe custom story fragment data.
optionsAddStoryFragmentOptionsOptional parameters for adding the story fragment.
Returns
- bool
A boolean indicating whether the operation succeeded or not.
Exceptions
- ArgumentNullException
Thrown if any required arguments are null.
- InvalidOperationException
Thrown if the game is not active.
IsCurrentStoryPack(StoryPackInfo)
Check if the current story pack matches the given
StoryPackInfo.
public static bool IsCurrentStoryPack(StoryPackInfo storyPack)
Parameters
storyPackStoryPackInfoThe
StoryPackInfoto test against.
Returns
- bool
A boolean indicating whether the current story pack matches the given
StoryPackInfo.
ReportExistsInCurrentTurn(string)
Check if a report exists in the current turn.
public static bool ReportExistsInCurrentTurn(string name)
Parameters
namestringThe name of the report.
Returns
- bool
A boolean indicating whether the report exists in the current turn.
StoryFragmentExistsInCurrentStep(string)
Check if a story fragment exists in the current step.
public static bool StoryFragmentExistsInCurrentStep(string name)
Parameters
namestringThe name of the story fragment.
Returns
- bool
A boolean indicating whether the story fragment exists in the current step.