Class SlugBaseCharacter.FeatureList
Stores the Features of a SlugBaseCharacter.
Inherited Members
Namespace: SlugBase
Assembly: SlugBase.dll
Syntax
public class SlugBaseCharacter.FeatureList : IEnumerable<Feature>, IEnumerable
Constructors
View SourceFeatureList()
Declaration
public FeatureList()
Methods
View SourceContains(Feature)
Check this list for a Feature.
Declaration
public bool Contains(Feature feature)
Parameters
| Type | Name | Description |
|---|---|---|
| Feature | feature | The Feature to check for. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetEnumerator()
Returns an enumerator that iterates through all features in this collection.
Declaration
public IEnumerator<Feature> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<Feature> |
Remove(Feature)
Remove a Feature.
Declaration
public bool Remove(Feature feature)
Parameters
| Type | Name | Description |
|---|---|---|
| Feature | feature | The feature to remove. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Some features are only read occasionally, such as when starting a game or entering a room. Instead of modifying features during gameplay, consider defining a custom Feature<T> and corresponding Data<THolder, TValue>.
Set(Feature, JsonAny)
Declaration
public void Set(Feature feature, JsonAny value)
Parameters
| Type | Name | Description |
|---|---|---|
| Feature | feature | The feature to add or replace. |
| JsonAny | value | The feature's new value. |
Remarks
Some features are only read occasionally, such as when starting a game or entering a room. Instead of modifying features during gameplay, consider defining a custom Feature<T> and corresponding Data<THolder, TValue>.
Exceptions
| Type | Condition |
|---|---|
| JsonException |
|
TryGet<T>(Feature<T>, out T)
Get the value of a Feature<T>.
Declaration
public bool TryGet<T>(Feature<T> feature, out T value)
Parameters
| Type | Name | Description |
|---|---|---|
| Feature<T> | feature | The feature to get data from. |
| T | value | The feature's data, or |
Returns
| Type | Description |
|---|---|
| bool |
|
Type Parameters
| Name | Description |
|---|---|
| T | The Feature<T>'s data type. |