Ejemplo n.º 1
0
        private HashSet <Vector2i> ChunkEdge(HashSet <Vector2i> cellsInBiome, CellInfoCom[,] cells, long edgeSeed)
        {
            var edges = new HashSet <Vector2i>();

            foreach (var cell in cellsInBiome)
            {
                var adjacent = Utility.GetAdjacentSquares(cell.X, cell.Y, cells);
                if (adjacent.Any(i => !cellsInBiome.Contains(i)))
                {
                    var nextSeed = edgeSeed + (((cell.X * 1691275049) + (cell.Y * 76045141)) % 3153608179);
                    Utility.AddAll(edges, GrowEdge(cell, cellsInBiome, adjacent, cells, nextSeed));
                }
            }

            return(edges);
        }