Skip to content

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

License

Notifications You must be signed in to change notification settings

kaleidawave/randomizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages