Class LimitMapper
Inheritance
System.Object
LimitMapper
Namespace: Eco.Shared.Utils
Assembly: Eco.Shared.dll
Syntax
public static class LimitMapper : Object
Methods
Map(Single, LimitMapper.Config)
Maps an input to an output, such that as the input reaches infinity, the output will approach (but never reach) a hard cap.
Declaration
public static float Map(float val, LimitMapper.Config values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | val | |
| LimitMapper.Config | values |
Returns
| Type | Description |
|---|---|
| System.Single |
MapAndDescribe(Single, LimitMapper.Config, LocString, Func<Single, LocString>, Func<Single, LocString>, LocString)
Maps the given input value to an output value, using the limits defined in 'values'.
Declaration
public static (float, LocString) MapAndDescribe(float val, LimitMapper.Config config, LocString outputName, Func<float, LocString> inputValDescription, Func<float, LocString> outputValDescription, LocString header)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | val | The value to map to an output |
| LimitMapper.Config | config | The config values for how the mapping occurs |
| LocString | outputName | What is the name of the resulting value type. |
| System.Func<System.Single, LocString> | inputValDescription | A function that renders an input value (incase you want special colors/icons) |
| System.Func<System.Single, LocString> | outputValDescription | A function that renders an output value (incase you want special colors/icons) |
| LocString | header | Text to show at the top of our display. |
Returns
| Type | Description |
|---|---|
| System.ValueTuple<System.Single, LocString> |