public void LoadMap(LoadMapParams loadMapParams)
        {
            MapX          = loadMapParams.MapX;
            MapY          = loadMapParams.MapY;
            IslandHandler = new IslandService(MapX, MapY);

            VoronoiGraph voronoiMap = null;

            for (int i = 0; i < 3; i++)
            {
                voronoiMap = Fortune.ComputeVoronoiGraph(loadMapParams.Points);
                foreach (Vector vector in loadMapParams.Points)
                {
                    double v0  = 0.0d;
                    double v1  = 0.0d;
                    int    say = 0;
                    foreach (VoronoiEdge edge in voronoiMap.Edges)
                    {
                        if (edge.LeftData == vector || edge.RightData == vector)
                        {
                            double p0 = (edge.VVertexA[0] + edge.VVertexB[0]) / 2;
                            double p1 = (edge.VVertexA[1] + edge.VVertexB[1]) / 2;
                            v0 += double.IsNaN(p0) ? 0 : p0;
                            v1 += double.IsNaN(p1) ? 0 : p1;
                            say++;
                        }
                    }

                    if (((v0 / say) < MapX) && ((v0 / say) > 0))
                    {
                        vector[0] = v0 / say;
                    }

                    if (((v1 / say) < MapY) && ((v1 / say) > 0))
                    {
                        vector[1] = v1 / say;
                    }
                }
            }



            voronoiMap = Fortune.ComputeVoronoiGraph(loadMapParams.Points);
            ImproveMapData(voronoiMap, loadMapParams.Fix);
        }
        public void LoadMap(LoadMapParams loadMapParams)
        {
            MapX = loadMapParams.MapX;
            MapY = loadMapParams.MapY;
            IslandHandler = new IslandService(MapX, MapY);

            VoronoiGraph voronoiMap = null;
            for (int i = 0; i < 3; i++)
            {
                voronoiMap = Fortune.ComputeVoronoiGraph(loadMapParams.Points);
                foreach (Vector vector in loadMapParams.Points)
                {
                    double v0 = 0.0d;
                    double v1 = 0.0d;
                    int say = 0;
                    foreach (VoronoiEdge edge in voronoiMap.Edges)
                    {
                        if (edge.LeftData == vector || edge.RightData == vector)
                        {
                            double p0 = (edge.VVertexA[0] + edge.VVertexB[0]) / 2;
                            double p1 = (edge.VVertexA[1] + edge.VVertexB[1]) / 2;
                            v0 += double.IsNaN(p0) ? 0 : p0;
                            v1 += double.IsNaN(p1) ? 0 : p1;
                            say++;
                        }
                    }

                    if (((v0 / say) < MapX) && ((v0 / say) > 0))
                    {
                        vector[0] = v0 / say;
                    }

                    if (((v1 / say) < MapY) && ((v1 / say) > 0))
                    {
                        vector[1] = v1 / say;
                    }
                }
            }

            voronoiMap = Fortune.ComputeVoronoiGraph(loadMapParams.Points);
            ImproveMapData(voronoiMap, loadMapParams.Fix);
        }