Beispiel #1
0
 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;
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 public void CopyFrom(DiceRule dr)
 {
     Dices = dr.Dices.ToList();
     Name = dr.Name;
     Revision = dr.Revision;
 }
Beispiel #4
0
 public DiceRule Clone()
 {
     var dr = new DiceRule();
     dr.Dices = Dices.ToList();
     dr.Name = Name;
     dr.Revision = Revision;
     return dr;
 }
Beispiel #5
0
 public void Roll(DiceRule dr)
 {
     Client.ChatManager.AddLine(LocaleString.Get("$hiddenroll"), dr.GetResultString(), DateTime.Now);
 }
Beispiel #6
0
 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();
 }