ScoreObjectMethodsGetScoreIDT(ListIScoreObject, String) Method

Retrieves the ID of a ScoreObject of a specific type, identified by a key, from an array of IScoreObjects.

Definition

Namespace: Alteruna.Scoreboard
Assembly: Alteruna.Trinity (in Alteruna.Trinity.dll) Version: 1.3.4
C#
public static int GetScoreID<T>(
	this List<IScoreObject> scoreList,
	string key
)
where T : struct, new(), IConvertible

Parameters

scoreList  ListIScoreObject
The array of IScoreObjects to search through.
key  String
The key of the ScoreObject to find the ID for.

Type Parameters

T
The type of the ScoreObject to retrieve the ID for.

Return Value

Int32
The ID of the ScoreObject, if found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ListIScoreObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

KeyNotFoundExceptionThrown if no score of the specified type with the given key is found.

See Also