Esempio n. 1
0
        private void GenereateColors(int usedColorsCount)
        {
            for (int j = 0; j < Height; j++)
            {
                for (int i = 0; i < Width; i++)
                {
                    var color = AvalibleColors.GetRandomColor(usedColorsCount);

                    Grid[j, i] = new Element
                    {
                        Color = color,
                        Point = new Point(i, j),
                        State = FieldState.Neutral
                    };
                }
            }
        }
Esempio n. 2
0
        private void SetUpPlayersStartPoints()
        {
            Grid[0, 0] = new Element()
            {
                Color = AvalibleColors.GetPlayer1Color(),
                Point = new Point(0, 0),
                State = FieldState.Player1
            };

            var rightDown = new Point(Width - 1, Height - 1);

            Grid[rightDown.Y, rightDown.X] = new Element()
            {
                Color = AvalibleColors.GetPlayer2Color(),
                Point = rightDown,
                State = FieldState.Player2
            };
        }