DocFX + Singulink = ♥

Class SlugBaseCharacter.FeatureList

Stores the Features of a SlugBaseCharacter.

Inheritance
object
SlugBaseCharacter.FeatureList
Implements
IEnumerable<Feature>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SlugBase
Assembly: SlugBase.dll
Syntax
public class SlugBaseCharacter.FeatureList : IEnumerable<Feature>, IEnumerable

Constructors

View Source

FeatureList()

Declaration
public FeatureList()

Methods

View Source

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
bool

true if feature was found, false otherwise.

View Source

GetEnumerator()

Returns an enumerator that iterates through all features in this collection.

Declaration
public IEnumerator<Feature> GetEnumerator()
Returns
Type Description
IEnumerator<Feature>
View Source

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

true if the feature was present, false otherwise.

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>.

View Source

Set(Feature, JsonAny)

Add a Feature or replace an existing Feature's value.

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

value was not a valid value for feature.

View Source

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 T's default value if it was not found.

Returns
Type Description
bool

true if the feature was found, false otherwise.

Type Parameters
Name Description
T

The Feature<T>'s data type.

Implements

IEnumerable<T>
IEnumerable