Ejemplo n.º 1
0
        /// <summary>
        /// Sets up the collection of Squares that make up the board.
        /// </summary>
        private void setupSquares()
        {
            // Go...
            var go = new Square_Bottom();

            go.Top    = BOARD_OFFSET_Y + 434;
            go.Bottom = BOARD_OFFSET_Y + 500;
            go.Left   = BOARD_OFFSET_X + 434;
            go.Right  = BOARD_OFFSET_X + 500;
            m_squares.Add(go);

            // The other bottom squares...
            for (int i = 0; i < 9; ++i)
            {
                var square = new Square_Bottom();
                square.Bottom = BOARD_OFFSET_Y + 500;
                square.Top    = square.Bottom - 67;
                square.Left   = BOARD_OFFSET_X + (int)(394 - i * 40.8);
                square.Right  = square.Left + 41;
                m_squares.Add(square);
            }

            // Jail....
            var jail = new Square_Jail();

            jail.Bottom = BOARD_OFFSET_Y + 500;
            jail.Top    = jail.Bottom - 67;
            jail.Left   = BOARD_OFFSET_X;
            jail.Right  = jail.Left + 67;
            m_squares.Add(jail);

            // The left squares...
            for (int i = 0; i < 9; ++i)
            {
                var square = new Square_Left();
                square.Top    = BOARD_OFFSET_Y + (int)(392 - i * 40.8);
                square.Bottom = square.Top + 41;
                square.Left   = BOARD_OFFSET_X;
                square.Right  = square.Left + 67;
                m_squares.Add(square);
            }

            // Free Parking...
            var freeParking = new Square_Bottom();

            freeParking.Top    = BOARD_OFFSET_Y;
            freeParking.Bottom = freeParking.Top + 67;
            freeParking.Left   = BOARD_OFFSET_X;
            freeParking.Right  = freeParking.Left + 67;
            m_squares.Add(freeParking);

            // The other top squares...
            for (int i = 0; i < 9; ++i)
            {
                var square = new Square_Top();
                square.Top    = BOARD_OFFSET_Y;
                square.Bottom = square.Top + 67;
                square.Left   = BOARD_OFFSET_X + (int)(67 + i * 40.8);
                square.Right  = square.Left + 41;
                m_squares.Add(square);
            }

            // Go To Jail...
            var goToJail = new Square_Right();

            goToJail.Top    = BOARD_OFFSET_Y;
            goToJail.Bottom = goToJail.Top + 67;
            goToJail.Right  = BOARD_OFFSET_X + 500;
            goToJail.Left   = goToJail.Right - 67;
            m_squares.Add(goToJail);

            // The other right squares...
            for (int i = 0; i < 9; ++i)
            {
                var square = new Square_Right();
                square.Top    = BOARD_OFFSET_Y + (int)(67 + i * 40.8);
                square.Bottom = square.Top + 41;
                square.Right  = BOARD_OFFSET_X + 500;
                square.Left   = square.Right - 67;
                m_squares.Add(square);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets up the collection of Squares that make up the board.
        /// </summary>
        private void setupSquares()
        {
            // Go...
            var go = new Square_Bottom();
            go.Top = BOARD_OFFSET_Y + 434;
            go.Bottom = BOARD_OFFSET_Y + 500;
            go.Left = BOARD_OFFSET_X + 434;
            go.Right = BOARD_OFFSET_X + 500;
            m_squares.Add(go);

            // The other bottom squares...
            for(int i=0; i<9; ++i)
            {
                var square = new Square_Bottom();
                square.Bottom = BOARD_OFFSET_Y + 500;
                square.Top = square.Bottom - 67;
                square.Left = BOARD_OFFSET_X + (int)(394 - i * 40.8);
                square.Right = square.Left + 41;
                m_squares.Add(square);
            }

            // Jail....
            var jail = new Square_Jail();
            jail.Bottom = BOARD_OFFSET_Y + 500;
            jail.Top = jail.Bottom - 67;
            jail.Left = BOARD_OFFSET_X;
            jail.Right = jail.Left + 67;
            m_squares.Add(jail);

            // The left squares...
            for (int i = 0; i < 9; ++i)
            {
                var square = new Square_Left();
                square.Top = BOARD_OFFSET_Y + (int)(392 - i * 40.8);
                square.Bottom = square.Top + 41;
                square.Left = BOARD_OFFSET_X;
                square.Right = square.Left + 67;
                m_squares.Add(square);
            }

            // Free Parking...
            var freeParking = new Square_Bottom();
            freeParking.Top = BOARD_OFFSET_Y;
            freeParking.Bottom = freeParking.Top + 67;
            freeParking.Left = BOARD_OFFSET_X;
            freeParking.Right = freeParking.Left + 67;
            m_squares.Add(freeParking);

            // The other top squares...
            for (int i = 0; i < 9; ++i)
            {
                var square = new Square_Top();
                square.Top = BOARD_OFFSET_Y;
                square.Bottom = square.Top + 67;
                square.Left = BOARD_OFFSET_X + (int)(67 + i * 40.8);
                square.Right = square.Left + 41;
                m_squares.Add(square);
            }

            // Go To Jail...
            var goToJail = new Square_Right();
            goToJail.Top = BOARD_OFFSET_Y;
            goToJail.Bottom = goToJail.Top + 67;
            goToJail.Right = BOARD_OFFSET_X + 500;
            goToJail.Left = goToJail.Right - 67;
            m_squares.Add(goToJail);

            // The other right squares...
            for (int i = 0; i < 9; ++i)
            {
                var square = new Square_Right();
                square.Top = BOARD_OFFSET_Y + (int)(67 + i * 40.8);
                square.Bottom = square.Top + 41;
                square.Right = BOARD_OFFSET_X + 500;
                square.Left = square.Right - 67;
                m_squares.Add(square);
            }
        }