Beispiel #1
0
        /*
         * The closest biome cell to the specified location(uses the Chebyshev distance function).
         */
        public BiomeCell ClosestCell(Coordinates2D location)
        {
            BiomeCell cell     = null;
            var       distance = double.MaxValue;

            foreach (var C in BiomeCells)
            {
                var _distance = Distance(location, C.CellPoint);
                if (_distance < distance)
                {
                    distance = _distance;
                    cell     = C;
                }
            }

            return(cell);
        }
Beispiel #2
0
 public void AddCell(BiomeCell cell)
 {
     BiomeCells.Add(cell);
 }