Example #1
0
 public void ChangeFOVBoard(FOVStatus status, int x, int y)
 {
     if (board.IndexOutOfRange(x, y))
     {
         return;
     }
     fovBoard[x, y] = status;
 }
Example #2
0
 public void ChangeStatus(bool isPassable, int x, int y)
 {
     if (dungeon.IndexOutOfRange(x, y))
     {
         return;
     }
     board[x, y] = isPassable;
     return;
 }
Example #3
0
        private void UpdateDistanceBoard()
        {
            if (checkPosition.Count < 1)
            {
                return;
            }

            position = checkPosition.Pop();
            surround = coordinate.SurroundCoord(Surround.Diagonal, position);

            foreach (var grid in surround)
            {
                gridX = grid[0];
                gridY = grid[1];

                if (board.IndexOutOfRange(gridX, gridY))
                {
                    continue;
                }

                if (board.CheckBlock(SubObjectTag.Wall, grid))
                {
                    wallGrid.Push(grid);
                }
                else if (distanceBoard[gridX, gridY] < 0)
                {
                    checkPosition.Push(grid);
                }

                distanceBoard[gridX, gridY] = board.GetDistance(source, grid);
            }

            UpdateDistanceBoard();
        }