Class PlayerFeature<T>
A constant setting of a SlugBaseCharacter's player.
Inherited Members
Namespace: SlugBase.Features
Assembly: SlugBase.dll
Syntax
public class PlayerFeature<T> : Feature<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type that stores this setting's information |
Constructors
View SourcePlayerFeature(string, Func<JsonAny, T>)
Creates a new PlayerFeature<T> with the given id.
Declaration
public PlayerFeature(string id, Func<JsonAny, T> factory)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The JSON key. |
| Func<JsonAny, T> | factory | A delegate that parses JsonAny into |
Methods
View SourceTryGet(Player, out T)
Gets the T instance assocated with player.
Declaration
public bool TryGet(Player player, out T value)
Parameters
| Type | Name | Description |
|---|---|---|
| Player | player | A Player instance that may be a SlugBaseCharacter with this Feature. |
| T | value | The stored setting, or |
Returns
| Type | Description |
|---|---|
| bool |
|