Class PlayerFeature<T>
A constant setting of a SlugBaseCharacter's player.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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
PlayerFeature(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 |
---|---|---|
System.String | id | The JSON key. |
System.Func<JsonAny, T> | factory | A delegate that parses JsonAny into |
Methods
TryGet(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 |
---|---|
System.Boolean |
|