Пример #1
0
        public static void SetUpBoard()
        {
            gameBoard[START_SQUARE] = new Square("Start", START_SQUARE);
            gameBoard[FINISH_SQUARE] = new Square("Finish", FINISH_SQUARE);

            for (int i = 1; i < FINISH_SQUARE; i++ )
            {
                if (i % 10 == 0)
                {
                    gameBoard[i] = new Lose_Square(i.ToString(), i);
                }
                else if (i % 5 == 0)
                {
                    gameBoard[i] = new Win_Square(i.ToString(), i);
                }
                else if (i % 6 == 0)
                {
                    gameBoard[i] = new Chance_Square(i.ToString(), i);
                }
                else
                {
                    gameBoard[i] = new Square(i.ToString(), i);
                }

            }
        }
Пример #2
0
        public SquareControl(Square square, BindingList<Player> players)
        {
            this.square = square;
            this.players = players;

            //  Set GUI properties of the whole square.
            Size = new Size(SQUARE_SIZE, SQUARE_SIZE);
            Margin = new Padding(0);  // No spacing around the cell. (Default is 3 pixels.)
            Dock = DockStyle.Fill;
            BorderStyle = BorderStyle.FixedSingle;
            BackColor = Color.CornflowerBlue;

            SetImageWhenNeeded();
        }
Пример #3
0
 public void SetLocation(Square location)
 {
     this.location = location;
 }
Пример #4
0
 public Player(string name, Square location)
 {
     this.name = name;
     this.location = location;
 }