public static DiceRule FromRule(int count, Dice dice, int revision) { var dr = new DiceRule(); for (int i = 0; i < count; ++i) dr.Dices.Add(dice); dr.Revision = revision; return dr; }
private void ModifyDiceRule(DiceRule dr) { var diceRuleForm = new DiceRuleForm(); diceRuleForm.Result = dr; if (diceRuleForm.ShowDialog() != DialogResult.OK) return; if (InputBoxForm.Open(LocaleString.Get("$askdiceruletitle"), "", dr.Name) != DialogResult.OK) return; dr.CopyFrom(diceRuleForm.Result); dr.Name = InputBoxForm.Answer; }
public void CopyFrom(DiceRule dr) { Dices = dr.Dices.ToList(); Name = dr.Name; Revision = dr.Revision; }
public DiceRule Clone() { var dr = new DiceRule(); dr.Dices = Dices.ToList(); dr.Name = Name; dr.Revision = Revision; return dr; }
public void Roll(DiceRule dr) { Client.ChatManager.AddLine(LocaleString.Get("$hiddenroll"), dr.GetResultString(), DateTime.Now); }
private void confirmButton_Click(object sender, EventArgs e) { Result = DiceRule.FromRule((int)diceCountNumericUpDown.Value, Dice.FromNumber((int)diceNumberNumericUpDown.Value), (int)revisionNumericUpDown.Value); DialogResult = DialogResult.OK; Close(); }