Class SlugBaseCharacter.FeatureList
Stores the Features of a SlugBaseCharacter.
Inheritance
Inherited Members
Namespace: SlugBase
Assembly: SlugBase.dll
Syntax
public class FeatureList : IEnumerable<Feature>, IEnumerable
Constructors
FeatureList()
Stores the Features of a SlugBaseCharacter.
Declaration
public FeatureList()
Methods
Contains(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 |
---|---|
System.Boolean |
|
GetEnumerator()
Returns an enumerator that iterates through all features in this collection.
Declaration
public IEnumerator<Feature> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.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 |
---|---|
System.Boolean |
|
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 |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | The Feature<T>'s data type. |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Stores the Features of a SlugBaseCharacter.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |