Exemplo n.º 1
0
    public bool RemoveType(DieSide type)
    {
        // Select a die that matches the type, prioritize those that aren't uncancellable
        Die dieToCancel = DiceList
                          .OrderBy(d => d.IsUncancelable)
                          .FirstOrDefault(d => d.Side == type);

        if (dieToCancel != null)
        {
            dieToCancel.Cancel();
            dieToCancel.RemoveModel();
            DiceList.Remove(dieToCancel);
            return(true);
        }
        else
        {
            return(false);
        }
    }