namespace Masuit.Tools.RandomSelector { public class WeightedItem { /// /// 权重 /// public int Weight; /// /// 元素 /// public readonly T Value; /// /// 累计权重 /// internal int CumulativeWeight; public WeightedItem(T value, int weight) { Value = value; Weight = weight; CumulativeWeight = 0; } } }