Class SetValueUserToolStateBase<TBrushTarget, TTerrainLayer, TDataLayer, TCellValue>
Inheritance
Implements
Inherited Members
Namespace: Fwt.HexTerrains.UserTools.SM.States
Assembly: fwt.hexterrains.dll
Syntax
public abstract class SetValueUserToolStateBase<TBrushTarget, TTerrainLayer, TDataLayer, TCellValue> : DataLayerBrushUserToolState<TBrushTarget, UserToolSettingsDataSource, UniversalToolSettingsScreen, TTerrainLayer, TDataLayer, TCellValue>, ISmState where TBrushTarget : HexTerrainLayerGroup where TTerrainLayer : HexTerrainLayer where TDataLayer : CellValueDataLayer<TCellValue> where TCellValue : unmanaged
Type Parameters
| Name | Description |
|---|---|
| TBrushTarget | |
| TTerrainLayer | |
| TDataLayer | |
| TCellValue |
Constructors
SetValueUserToolStateBase(ISmState)
Declaration
protected SetValueUserToolStateBase(ISmState parent)
Parameters
| Type | Name | Description |
|---|---|---|
| ISmState | parent |
Fields
ReadValueKey
When this key is pressed, click will read elevation under cursor instead of applying it
Declaration
public KeyCode ReadValueKey
Field Value
| Type | Description |
|---|---|
| KeyCode |
_isClampCellValue
Declaration
protected bool _isClampCellValue
Field Value
| Type | Description |
|---|---|
| bool |
_maxCellValue
Declaration
protected TCellValue _maxCellValue
Field Value
| Type | Description |
|---|---|
| TCellValue |
_minCellValue
Declaration
protected TCellValue _minCellValue
Field Value
| Type | Description |
|---|---|
| TCellValue |
Properties
CellValue
Value to be applied to the terrain data layer cells.
Declaration
public virtual TCellValue CellValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TCellValue |
DataSourceItemsCount
Amount of DataSource entries this class contributes to the settings screen. The first entry is reserved for the terrain layer index, the second for the cell value.
Declaration
public int DataSourceItemsCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsClampCellValue
If true, the cell value will be clamped between MinCellValue and MaxCellValue
Declaration
public virtual bool IsClampCellValue { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MaxCellValue
Maximum cell value when clamping is enabled
Declaration
public virtual TCellValue MaxCellValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TCellValue |
MinCellValue
Minimum cell value when clamping is enabled
Declaration
public virtual TCellValue MinCellValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TCellValue |
TerrainLayerIndex
If IsGetLayerByIndex is true, this index is used to get terrain layer from terrain layers list."/>
Declaration
public override int TerrainLayerIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Methods
ApplyBrush(int, int2, int, TBrushTarget, int)
Applies brush to the brushView. Returns true if changes were applied
Declaration
public override bool ApplyBrush(int brushMode, int2 cellCoord, int cellIndex, TBrushTarget brushTarget, int mouseButton)
Parameters
| Type | Name | Description |
|---|---|---|
| int | brushMode | |
| int2 | cellCoord | |
| int | cellIndex | |
| TBrushTarget | brushTarget | |
| int | mouseButton |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Init(UserToolStateSettings)
Initializes the tool state with the specified settings.
Declaration
public override void Init(UserToolStateSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| UserToolStateSettings | settings | The settings to apply to the tool state. Cannot be null. |
Overrides
InitDefaultSettings()
Initializes the default settings for the current instance. This method is intended to be overridden in derived classes to configure initial values or options as needed.
Declaration
protected override void InitDefaultSettings()
Overrides
Remarks
Override this method in a subclass to provide custom initialization logic for default settings. The base implementation does not perform any actions.
Init<TInitArgs>(TInitArgs)
Initializes the tool using the specified initialization arguments.
Declaration
public override void Init<TInitArgs>(TInitArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| TInitArgs | args | The initialization arguments used to configure the tool. If the argument implements IUserToolStateConfig, its ToolSettings are used; otherwise, default settings are applied. |
Type Parameters
| Name | Description |
|---|---|
| TInitArgs | The type of the initialization arguments used to configure the tool. If the type implements IUserToolStateConfig, its ToolSettings will be used; otherwise, default settings are applied. |
Overrides
IsAppliedToEveryCellOnMap(int)
Determines whether the specified brush mode applies to every cell on the map.
Declaration
public override bool IsAppliedToEveryCellOnMap(int brushMode)
Parameters
| Type | Name | Description |
|---|---|---|
| int | brushMode | The brush mode to evaluate. Typically, a value of 1 indicates that the brush is applied to all cells. |
Returns
| Type | Description |
|---|---|
| bool | true if the brush mode applies to every cell on the map; otherwise, false. |
Overrides
LoadSettings()
Loads configuration settings for the current instance. Derived classes override this method to implement custom settings initialization.
Declaration
protected override void LoadSettings()
Overrides
Remarks
Override this method in a subclass to provide specific logic for loading or initializing settings. This method is called during the setup or initialization phase and does not perform any actions in the base implementation.
ReadCellValue(TDataLayer)
Attempts to read the value of the terrain cell currently targeted by the raycast and updates the cell value if available.
Declaration
protected virtual void ReadCellValue(TDataLayer dataLayer)
Parameters
| Type | Name | Description |
|---|---|---|
| TDataLayer | dataLayer | The data layer from which to retrieve cell values. Cannot be null. |
Remarks
If no cell is targeted by the raycast or the cell value cannot be retrieved, the method does not update the cell value or settings screen.
SaveSettings()
Saves the current settings to the underlying storage or configuration source.
Declaration
protected override void SaveSettings()
Overrides
Remarks
Override this method in a derived class to implement custom logic for persisting settings. This method does not perform any action in the base implementation.