|
WeightedCollectionTGetWeightTItemWeight Method (T) |
Gets the weight controller object of an item with specific controller type requested.
Namespace: JLChnToZ.LuckyPlayer.WeightedRandomizerAssembly: LuckyPlayer (in LuckyPlayer.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public TItemWeight GetWeight<TItemWeight>(
T item
)
where TItemWeight : Object, IItemWeight<T>
Public Function GetWeight(Of TItemWeight As {Object, IItemWeight(Of T)}) (
item As T
) As TItemWeight
public:
generic<typename TItemWeight>
where TItemWeight : Object, IItemWeight<T>
TItemWeight GetWeight(
T item
)
member GetWeight :
item : 'T -> 'TItemWeight when 'TItemWeight : Object and IItemWeight<'T>
Parameters
- item
- Type: T
The item
Type Parameters
- TItemWeight
- A type that implements weight controller interface.
Return Value
Type:
TItemWeightThe weight controller object,
null (or default value if type is valuetype such as structure) if item not found or type of weight controller does not match.
See Also