public PuzzlynBoardSnapShot(PuzzlynBoard puzzlynBoard)
 {
     var rows = puzzlynBoard.PuzzlynBoardLocationGrid.GetLength(0);
     var columns = puzzlynBoard.PuzzlynBoardLocationGrid.GetLength(1);
     PuzzlynBoardLocationGrid = new PuzzlynBoardLocation[rows,columns];
     for (var y = 0; y < rows; y++)
         for (var x = 0; x < columns; x++)
             PuzzlynBoardLocationGrid[y, x] = new PuzzlynBoardLocation(puzzlynBoard.PuzzlynBoardLocationGrid[y, x]);
 }
Example #2
0
        private static long _currentGameInstanceId = 133337; //seed this at 2UVT so it's not boring >.>

        #endregion Fields

        #region Constructors

        public GameInstance(string gameName, Image image, Difficulty difficulty)
        {
            if (String.IsNullOrWhiteSpace(gameName))
                gameName = null;

            GameInstanceId = Base36.Encode(Interlocked.Increment(ref _currentGameInstanceId));

            Connections = new ConcurrentCollection<string>();
            GameName = gameName;
            Image = image;
            SlicedImageSettings = image.GetSlicedImageSettings(difficulty);

            //Board is two places larger in each direction to give work space
            PuzzlynBoard = new PuzzlynBoard(SlicedImageSettings.NumberOfImageRows, SlicedImageSettings.NumberOfImageColumns);
        }