Пример #1
0
    private List <MultiDiceRoll> MultipleDice()
    {
        List <MultiDiceRoll> mult = new List <MultiDiceRoll>();

        for (int i = 0; i < dice_roll.Count; i++)
        {
            for (int j = i + 1; j < dice_roll.Count; j++)
            {
                if (dice_roll [i].roll_value == dice_roll [j].roll_value)
                {
                    MultiDiceRoll d_roll = mult.Find(delegate(MultiDiceRoll obj) {
                        return(obj.Face == dice_roll [i].roll_value);
                    });
                    if (d_roll != null)
                    {
                        d_roll.AddDie(dice_roll [j].ID);
                    }
                    else
                    {
                        mult.Add(new MultiDiceRoll(2, dice_roll [i].roll_value, dice_roll [i].ID, dice_roll [j].ID));
                    }
                }
            }
        }
        return(mult);
    }