/// <summary> /// Inserts a wheel to the wheel as a subslot, at the desired index. /// </summary> /// <param name="index">Insertion index</param> /// <param name="slot">Wheel to be added as a slot</param> /// <returns></returns> override public bool AddSlotAt(int index, WheelBase slot) { if (slot.Root == Root) { throw new Exceptions.SameWheelException(name, slot.name); } if (RootDistance + slot.Depth > DEPTH_MAX) { throw new Exceptions.MaxDepthReachedException(name, slot.name); } if (slot != null && ((Wheel)slot).SetParent(this)) { ResetDepth(); if (subslots.Count < index) { subslots.Add(slot); } else { subslots.Insert(index, slot); } UpdateTotal(); return(true); } return(false); }
public void Add(WheelBase slot, uint totalChance) { chosen.Add(slot); float singleChance = (float)slot.chance / totalChance; chance *= singleChance; }
/// <summary> /// Adds a wheel to the subwheel at the given index as a subslot. /// </summary> /// <param name="index">Index of the subwheel</param> /// <param name="slot">Wheel to be added as a slot</param> /// <returns></returns> override public bool AddSubslot(int index, WheelBase slot) { if (index < subslots.Count) { depth = -1; return(subslots[index].AddSlot(slot)); } return(false); }
/// <summary> /// Adds a wheel to the subwheel at the given index as a subslot. /// </summary> /// <param name="slotName">Name of the subwheel<</param> /// <param name="slot"></param> /// <param name="slot">Wheel to be added as a slot</param> /// <returns></returns> override public bool AddSubslot(string slotName, WheelBase slot) { if (slot == null) { return(false); } foreach (WheelBase subslot in subslots) { if (subslot.name == slotName) { depth = -1; return(subslot.AddSlot(slot)); } } return(false); }
/// <summary> /// Adds a wheel to the wheel as a subslot. /// </summary> /// <param name="slot">Wheel to be added as a slot</param> /// <returns></returns> override public bool AddSlot(WheelBase slot) { return(AddSlotAt(subslots.Count, slot)); }
public abstract bool AddSubslot(string slotName, WheelBase slot);
public abstract bool AddSubslot(int index, WheelBase slot);
public abstract bool AddSlot(WheelBase slot);