Example #1
0
 public async Task ShowRollingAsync(CustomBasicList <CustomBasicList <D> > diceCollection, bool showVisible)
 {
     CanShowDice = showVisible;
     AsyncDelayer.SetDelayer(this, ref _delay !); //because for multiplayer, they do this part but not the other.
     await diceCollection.ForEachAsync(async firsts =>
     {
         DiceList.ReplaceDiceRange(firsts);
         int tempCount = DiceList.Count;
         if (DiceList.Any(Items => Items.Index > tempCount || Items.Index <= 0))
         {
             throw new BasicBlankException("Index cannot be higher than the dicecount or less than 1");
         }
         HasDice = true;
         if (CanShowDice == true)
         {
             Visible = true;
             await _delay.DelayMilli(50);
         }
     });
 }
Example #2
0
 public void RemoveConditionalDice(Predicate <D> predicate)
 {
     DiceList.RemoveConditionalDice(predicate);
     HowManyDice = DiceList.Count;
 }
Example #3
0
 public void ReplaceDiceRange(ICustomBasicList <D> thisList)
 {
     DiceList.ReplaceDiceRange(thisList);
     HowManyDice = DiceList.Count;
 }
Example #4
0
 private void RedoList()
 {
     DiceList.Clear(HowManyDice);
 }
Example #5
0
 public void ClearDice()
 {
     HasDice     = true;
     HowManyDice = _originalNumber;
     DiceList.Clear(HowManyDice);
 }
Example #6
0
 public bool HasSelectedDice()
 => DiceList.Exists(items => items.IsSelected == true);
Example #7
0
 public void UnholdDice() => DiceList.ForEach(items => items.Hold = false);