Class BrushUserToolState<TBrushTarget, TSettings, TSettingsScreen>
Inheritance
Implements
Inherited Members
Namespace: Fwt.HexTerrains.UserTools.SM
Assembly: fwt.hexterrains.dll
Syntax
public abstract class BrushUserToolState<TBrushTarget, TSettings, TSettingsScreen> : BrushUserToolState<TBrushTarget, TSettings>, ISmState where TBrushTarget : class where TSettingsScreen : ToolSettingsScreen<TSettings>
Type Parameters
| Name | Description |
|---|---|
| TBrushTarget | |
| TSettings | |
| TSettingsScreen |
Constructors
BrushUserToolState(ISmState)
Declaration
protected BrushUserToolState(ISmState parent)
Parameters
| Type | Name | Description |
|---|---|---|
| ISmState | parent |
Properties
SettingsScreen
The settings UI Screen associated with the current instance.
Declaration
protected virtual TSettingsScreen SettingsScreen { get; set; }
Property Value
| Type | Description |
|---|---|
| TSettingsScreen |
Methods
GetSettingsScreen()
Retrieves the settings screen instance of type TSettingsScreen. If the instance has
not been created, it initializes and returns a new one.
Declaration
public virtual TSettingsScreen GetSettingsScreen()
Returns
| Type | Description |
|---|---|
| TSettingsScreen | The current instance of the settings screen of type |
Remarks
Subsequent calls to this method will return the same instance unless the settings screen is reset externally. This method ensures that only one instance of the settings screen is created per type.
PrepareToRun()
Performs any necessary initialization or setup required before executing the main operation. Called by state machine once when state becomes active. If state is disabled and then enabled again, this method will be called again.
Declaration
public override void PrepareToRun()
Overrides
Remarks
Override this method to implement preparation logic specific to the derived class. This method should be called prior to running the core functionality to ensure all prerequisites are met.
PrepareToStop()
Performs any necessary actions to prepare the object for stopping or shutdown. Called when the state is about to be deactivated.
Declaration
public override void PrepareToStop()
Overrides
Remarks
Implementations should ensure that all resources are released and any ongoing operations are safely terminated before the object is stopped. This method is typically called prior to disposing or shutting down the object to ensure a clean transition.
UpdateSettingsScreen()
Refreshes the settings screen to reflect the current state of the data source.
Declaration
public virtual void UpdateSettingsScreen()
Remarks
If the data source implements ICommitChanges, any pending changes are committed before the settings screen is updated. This ensures that the settings screen displays the most up-to-date information.