示例#1
0
        private void LoadSquares()
        {
            if (_gameContainer.SquareList !.Count == 0)
            {
                throw new BasicBlankException("Should have loaded the squares first.  Rethink");
            }
            int   z = 0;
            float currentLeft;
            float currentTop;
            var   startSize = GetActualSize(15, 15);

            currentTop = startSize.Height + _whiteRect.Location.Y;
            for (int x = 1; x <= 7; x++)
            {
                currentLeft = startSize.Width + _whiteRect.Location.X;
                for (int y = 1; y <= 7; y++)
                {
                    z++;
                    SquareInfo thisSquare = _gameContainer.SquareList[z];
                    thisSquare.Rectangle = SKRect.Create(currentLeft, currentTop, _squareHeight, _squareHeight);
                    currentLeft         += _spaceHeight;
                }
                currentTop += _spaceHeight;
            }
        }
示例#2
0
 private static void InitSquares(ConnectTheDotsGameContainer gameContainer)
 {
     gameContainer.SquareList = new System.Collections.Generic.Dictionary <int, SquareInfo>();
     for (int x = 1; x <= 7; x++)
     {
         for (int y = 1; y <= 7; y++)
         {
             SquareInfo thisSquare = new SquareInfo();
             thisSquare.Row    = x;
             thisSquare.Column = y;
             thisSquare.Color  = 0; //i think.
             gameContainer.SquareList.Add(gameContainer.SquareList.Count + 1, thisSquare);
         }
     }
 }