Beispiel #1
0
        private void ToggleDiceState(Rectangle _rect)
        {
            int i = 0;

            foreach (var item in diceRectangle)
            {
                if (item == _rect)
                {
                    DiceController.ChangeDiceState(i);
                    break;
                }
                ++i;
            }

            if (DiceController.Dices.ElementAt(i).DiceState == eDiceState.Unlocked)
            {
                _rect.Stroke = Brushes.Black;
            }
            else
            {
                _rect.Stroke = Brushes.Red;
            }
        }