public void VantageType_LimitsDiceCount(VantageType vantageType) { var diceTray = new DiceTray("d20", "5", "0", vantageType); int expected = 2; var actual = diceTray.DiceCount; Assert.Equal(expected, actual); }
private void RollButton_Click(object sender, RoutedEventArgs e) { VantageType vantageType = GetVantage(); var diceTray = new DiceTray(diceSelector.Text, diceCount.Text, modifier.Text, vantageType); var rollMessage = new RollMessage(diceTray); string message = $"You Rolled {rollMessage.RollMade}\n" + $"Your rolls were {rollMessage.Rolls}\n" + $"Result = {rollMessage.Result}"; MessageBox.Show(this, message, rollMessage.CritMessage); }
public void DiceRoll(string diceType, string diceCount, string bonus, VantageType vantageType = VantageType.NoVantage) { var stringToInt = new StringToInt(); Bonus = stringToInt.ZeroOrGreater(bonus); DiceCount = stringToInt.OneOrGreater(diceCount); DiceType = stringToInt.OneOrGreater(diceType); VantageType = vantageType; CheckVantageType(); RollDice(); Crit = CheckIfCrit(); }