Click or drag to resize
WeightedCollectionT Methods

The WeightedCollectionT generic type exposes the following members.

Methods
  Name Description
Public method Add(T)
Adds an item into the pool with default weight.
Public method Add(T, IItemWeightT)
Adds an item into the pool with dynamic weight definition.
Public method Add(T, Double)
Adds an item into the pool with static weight.
Public method AddRange
Batch add items into the pool
Public method Clear
Removes everything from the pool.
Public method Clone
Creates a copy of current pool.
Public method Contains
Is the pool contains the specified item?
Public method CopyTo
Copy the pool of items into an array starting from arrayIndex.
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected method Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public method GetCurrentWeight
Gets the weight of an item. If dynamic object is defined, the value will be fetched immediately.
Public method GetEnumerator
Gets an enumerator object for iterates through every items in the pool, even the weight is zero.
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method GetLargeAmountRandomItems
Get large amount of items from the pool. Assumes all weights are static.
Public method GetRandomItem(Double)
Get an item from the pool with random value passed.
Public method GetRandomItem(Random)
Get a random item from the pool.
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method GetWeight(T)
Gets the weight controller object of an item.
Public method GetWeightTItemWeight(T)
Gets the weight controller object of an item with specific controller type requested.
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method Remove
Removes an item from the pool.
Public method RemoveRange
Batch remove items from the pool. (if exists)
Public method SetWeight(T, IItemWeightT)
Binds the item with a dynamic weight controller
Public method SetWeight(T, Double)
Sets a static weight of an item.
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
See Also