Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 494 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 494 Bytes

Randomizer

A randomizer made in C# for choosing a random item with a weighted chance

Usage:

using Randomizer;

// Create an object that inherits the 'IWeighted' inheritance with the 'Weight' property
struct Reward: IWeighted
{
    int Weight { get; set; }
    ...
}

// Past a list of objects into the constructor
List<Reward> foo = ...
Randomizer<Reward> bar = new Randomizer<Reward>(foo);

// Retrieve results!!!
Reward x = bar.Pick();