/// <summary> /// Create a Voronoi Diagram using a list of points and a specified algorithm to use /// </summary> public static VoronoiDiagram CreateVoronoi(List <Point> points, GenerationSettings settings) { VoronoiDiagram voronoi; var startX = settings.StartX; var startY = settings.StartX; var width = settings.Width; var length = settings.Length; //Select algorithm to use switch (settings.VoronoiAlgorithm) { // Voronoi according to Boywer-Watson Algorithm // http://paulbourke.net/papers/triangulate/ case VoronoiAlgorithm.BoywerWatson: { voronoi = new BowyerWatsonGenerator().GetVoronoi(points); break; } // Voronoi according to Fortunes Algorithm // http://blog.ivank.net/fortunes-algorithm-and-implementation.html case VoronoiAlgorithm.Fortune: { voronoi = new FortuneGenerator().GetVoronoi(points); break; } default: throw new ArgumentOutOfRangeException(nameof(settings.VoronoiAlgorithm), settings.VoronoiAlgorithm, null); } voronoi.Bounds = new Rectangle(startX, startY, width, length); voronoi.Sites = points; voronoi.FinishVoronoi(); return(voronoi);; }
private void StartButtonClick() { LoadLevelSystem.LoadWheelScene(); FortuneGenerator.Generate(); }
private void OnSpinClick() { Rotate(FortuneGenerator.GetNewWinSectorIndex()); }
private void Start() { SetValues(FortuneGenerator.GetSectorValueList()); GameActions.SpinClick += OnSpinClick; }
private void OnSpinFinish() { IncreaseScore(FortuneGenerator.GetLastWinValue()); }