public static Brush GetEvaluationBrush(MyMasterMindEvaluationColors color)
        {
            if (_singleton == null)
            {
                _singleton = new DisplayColors();
            }

            return(_singleton.EvaluationBrushes[(int)color]);
        }
        public static Brush GetCodeBrush(MyMasterMindCodeColors color)
        {
            if (_singleton == null)
            {
                _singleton = new DisplayColors();
            }

            return(_singleton.CodeBrushes[(int)color]);
        }
Exemple #3
0
        internal void SetEvaluation(int black, int white)
        {
            int i;

            Evaluation.ToList().ForEach(e => { e.Fill = DisplayColors.GetEvaluationBrush(MyMasterMindEvaluationColors.None); });
            for (i = 0; i < black; i++)
            {
                Evaluation[i].Fill = DisplayColors.GetEvaluationBrush(MyMasterMindEvaluationColors.Black);
            }
            for (i = black; i < black + white; i++)
            {
                Evaluation[i].Fill = DisplayColors.GetEvaluationBrush(MyMasterMindEvaluationColors.White);
            }
        }
Exemple #4
0
        public GuessCell()
        {
            InitializeComponent();

            this.DataContext = this;

            Evaluation = new Rectangle[4];
            Field      = new CodeField[4];

            Evaluation[0] = Evaluation0;
            Evaluation[1] = Evaluation1;
            Evaluation[2] = Evaluation2;
            Evaluation[3] = Evaluation3;

            for (int i = 0; i < MyMasterMindConstants.Columns; i++)
            {
                Field[i] = new CodeField();
                this.CodeStackPanel.Children.Add(Field[i]);
            }

            Evaluation.ToList().ForEach(e => { e.Fill = DisplayColors.GetEvaluationBrush(MyMasterMindEvaluationColors.None); });
            Field.ToList().ForEach(e => { e.SetColor(MyMasterMindCodeColors.None); });
        }