From 3c3cbc995b592466fc405d13500f917dabe15308 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Sat, 9 Nov 2019 14:58:38 +0100 Subject: [PATCH] [otwarty teren] wydzielenie generowania ze skryptow unity part 2 --- Assets/{Map => Common}/Location.cs | 14 +------- Assets/Common/Location.cs.meta | 3 ++ Assets/{Map => Common}/LocationGenerator.cs | 3 +- Assets/Common/LocationGenerator.cs.meta | 3 ++ Assets/Common/LocationSite.cs | 15 ++++++++ Assets/Common/LocationSite.cs.meta | 3 ++ Assets/{Map => Common}/Map.cs | 12 +------ Assets/Common/Map.cs.meta | 3 ++ Assets/Common/MapSite.cs | 13 +++++++ Assets/Common/MapSite.cs.meta | 3 ++ Assets/Editor/GraphGeneratorUI.cs | 6 ++-- Assets/Generators.meta | 8 ----- Assets/Generators/INoiseGenerator.cs | 9 ----- Assets/Generators/INoiseGenerator.cs.meta | 11 ------ Assets/Generators/IslandGenerator.cs | 29 --------------- Assets/Generators/PerlinNoiseGenerator.cs | 36 ------------------- .../Generators/PerlinNoiseGenerator.cs.meta | 11 ------ Assets/Map.meta | 3 -- Assets/Map/Location.cs.meta | 3 -- Assets/Map/LocationGenerator.cs.meta | 3 -- Assets/Map/Map.cs.meta | 3 -- Assets/SampleScenes.meta | 8 ----- Assets/Scripts/CityGenerator.cs | 12 +++---- Assets/Scripts/ForestGenerator.cs | 7 ++-- ...GraphGenerator.cs => LandmassGenerator.cs} | 7 ++-- ...ator.cs.meta => LandmassGenerator.cs.meta} | 0 Assets/Scripts/MapRenderer.cs | 8 ++--- Assets/Scripts/PointDistribution.meta | 3 ++ .../PointDistribution/IPointDistribution.cs | 10 ++++++ .../IPointDistribution.cs.meta | 3 ++ .../PointDistribution}/PoissonDiskSampler.cs | 8 ++--- .../PoissonDiskSampler.cs.meta | 0 Assets/Tools/TikzExporter.cs | 10 ++++++ .../TikzExporter.cs.meta} | 2 +- Assets/Voronoi/VoronoiGenerator.cs | 1 - 35 files changed, 93 insertions(+), 180 deletions(-) rename Assets/{Map => Common}/Location.cs (82%) create mode 100644 Assets/Common/Location.cs.meta rename Assets/{Map => Common}/LocationGenerator.cs (98%) create mode 100644 Assets/Common/LocationGenerator.cs.meta create mode 100644 Assets/Common/LocationSite.cs create mode 100644 Assets/Common/LocationSite.cs.meta rename Assets/{Map => Common}/Map.cs (72%) create mode 100644 Assets/Common/Map.cs.meta create mode 100644 Assets/Common/MapSite.cs create mode 100644 Assets/Common/MapSite.cs.meta delete mode 100644 Assets/Generators.meta delete mode 100644 Assets/Generators/INoiseGenerator.cs delete mode 100644 Assets/Generators/INoiseGenerator.cs.meta delete mode 100644 Assets/Generators/IslandGenerator.cs delete mode 100644 Assets/Generators/PerlinNoiseGenerator.cs delete mode 100644 Assets/Generators/PerlinNoiseGenerator.cs.meta delete mode 100644 Assets/Map.meta delete mode 100644 Assets/Map/Location.cs.meta delete mode 100644 Assets/Map/LocationGenerator.cs.meta delete mode 100644 Assets/Map/Map.cs.meta delete mode 100644 Assets/SampleScenes.meta rename Assets/Scripts/{GraphGenerator.cs => LandmassGenerator.cs} (98%) rename Assets/Scripts/{GraphGenerator.cs.meta => LandmassGenerator.cs.meta} (100%) create mode 100644 Assets/Scripts/PointDistribution.meta create mode 100644 Assets/Scripts/PointDistribution/IPointDistribution.cs create mode 100644 Assets/Scripts/PointDistribution/IPointDistribution.cs.meta rename Assets/{Generators => Scripts/PointDistribution}/PoissonDiskSampler.cs (94%) rename Assets/{Generators => Scripts/PointDistribution}/PoissonDiskSampler.cs.meta (100%) create mode 100644 Assets/Tools/TikzExporter.cs rename Assets/{Generators/IslandGenerator.cs.meta => Tools/TikzExporter.cs.meta} (83%) diff --git a/Assets/Map/Location.cs b/Assets/Common/Location.cs similarity index 82% rename from Assets/Map/Location.cs rename to Assets/Common/Location.cs index 70ec54a..8f6e747 100644 --- a/Assets/Map/Location.cs +++ b/Assets/Common/Location.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using System.Linq; -using Assets.Common; using Assets.Voronoi; -namespace Assets.Map +namespace Assets.Common { public class Location { @@ -37,15 +36,4 @@ namespace Assets.Map BoundaryEdges = a.Union(b).Except(a.Intersect(b)).ToList(); } } - - public class LocationSite - { - public readonly Site Site; - public Location Location; - - public LocationSite(Site site) - { - Site = site; - } - } } \ No newline at end of file diff --git a/Assets/Common/Location.cs.meta b/Assets/Common/Location.cs.meta new file mode 100644 index 0000000..85e7d78 --- /dev/null +++ b/Assets/Common/Location.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: def8cfa113744a3bb21d99fddf782916 +timeCreated: 1573304795 \ No newline at end of file diff --git a/Assets/Map/LocationGenerator.cs b/Assets/Common/LocationGenerator.cs similarity index 98% rename from Assets/Map/LocationGenerator.cs rename to Assets/Common/LocationGenerator.cs index 7baf620..54c380b 100644 --- a/Assets/Map/LocationGenerator.cs +++ b/Assets/Common/LocationGenerator.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using Assets.Common; using Assets.Voronoi; using Random = System.Random; -namespace Assets.Map +namespace Assets.Common { public class LocationGenerator { diff --git a/Assets/Common/LocationGenerator.cs.meta b/Assets/Common/LocationGenerator.cs.meta new file mode 100644 index 0000000..28ca7e2 --- /dev/null +++ b/Assets/Common/LocationGenerator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1a667fae02f346199ad742a83f9d8610 +timeCreated: 1573304795 \ No newline at end of file diff --git a/Assets/Common/LocationSite.cs b/Assets/Common/LocationSite.cs new file mode 100644 index 0000000..23bfd72 --- /dev/null +++ b/Assets/Common/LocationSite.cs @@ -0,0 +1,15 @@ +using Assets.Voronoi; + +namespace Assets.Common +{ + public class LocationSite + { + public readonly Site Site; + public Location Location; + + public LocationSite(Site site) + { + Site = site; + } + } +} \ No newline at end of file diff --git a/Assets/Common/LocationSite.cs.meta b/Assets/Common/LocationSite.cs.meta new file mode 100644 index 0000000..cd682ba --- /dev/null +++ b/Assets/Common/LocationSite.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ae1606ff46e64c2a9dc080c61bbd74b8 +timeCreated: 1573304795 \ No newline at end of file diff --git a/Assets/Map/Map.cs b/Assets/Common/Map.cs similarity index 72% rename from Assets/Map/Map.cs rename to Assets/Common/Map.cs index 5417ecb..fd3f0e1 100644 --- a/Assets/Map/Map.cs +++ b/Assets/Common/Map.cs @@ -1,8 +1,7 @@ using System; -using Assets.Common; using UnityEngine; -namespace Assets.Map +namespace Assets.Common { [Serializable] public class Map @@ -31,13 +30,4 @@ namespace Assets.Map Seed = seed; } } - - [Serializable] - public class MapSite - { - public readonly Metadata Metadata = new Metadata(); - - [field: NonSerialized] - public Map Map { get; internal set; } - } } \ No newline at end of file diff --git a/Assets/Common/Map.cs.meta b/Assets/Common/Map.cs.meta new file mode 100644 index 0000000..afd083a --- /dev/null +++ b/Assets/Common/Map.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 087a8dc14fe944dfa2bef7a5fbaefc3d +timeCreated: 1573304795 \ No newline at end of file diff --git a/Assets/Common/MapSite.cs b/Assets/Common/MapSite.cs new file mode 100644 index 0000000..403dffc --- /dev/null +++ b/Assets/Common/MapSite.cs @@ -0,0 +1,13 @@ +using System; + +namespace Assets.Common +{ + [Serializable] + public class MapSite + { + public readonly Metadata Metadata = new Metadata(); + + [field: NonSerialized] + public Map Map { get; internal set; } + } +} \ No newline at end of file diff --git a/Assets/Common/MapSite.cs.meta b/Assets/Common/MapSite.cs.meta new file mode 100644 index 0000000..e052148 --- /dev/null +++ b/Assets/Common/MapSite.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1bff83ade11b42e49fce3ba4f779b5d2 +timeCreated: 1573304795 \ No newline at end of file diff --git a/Assets/Editor/GraphGeneratorUI.cs b/Assets/Editor/GraphGeneratorUI.cs index db757f2..8f717d1 100644 --- a/Assets/Editor/GraphGeneratorUI.cs +++ b/Assets/Editor/GraphGeneratorUI.cs @@ -6,7 +6,7 @@ using Random = UnityEngine.Random; namespace Editor { - [CustomEditor(typeof (GraphGenerator))] + [CustomEditor(typeof (LandmassGenerator))] public class GraphGeneratorUI : UnityEditor.Editor { private string _threshold; @@ -14,7 +14,7 @@ namespace Editor public override void OnInspectorGUI() { - GraphGenerator generator = (GraphGenerator)target; + LandmassGenerator generator = (LandmassGenerator)target; _showInfo = EditorGUILayout.Foldout(_showInfo, "Debug info"); @@ -65,7 +65,7 @@ namespace Editor private void OnSceneGUI() { - GraphGenerator generator = (GraphGenerator)target; + LandmassGenerator generator = (LandmassGenerator)target; if (generator.VoronoiGenerator != null) { diff --git a/Assets/Generators.meta b/Assets/Generators.meta deleted file mode 100644 index b3f2cdf..0000000 --- a/Assets/Generators.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 259153a10cc9545dbb826a5a4c315254 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Generators/INoiseGenerator.cs b/Assets/Generators/INoiseGenerator.cs deleted file mode 100644 index 87727de..0000000 --- a/Assets/Generators/INoiseGenerator.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEngine; - -namespace Generators -{ - public interface IGenerator - { - double GetValue(Vector2 position); - } -} \ No newline at end of file diff --git a/Assets/Generators/INoiseGenerator.cs.meta b/Assets/Generators/INoiseGenerator.cs.meta deleted file mode 100644 index cba8874..0000000 --- a/Assets/Generators/INoiseGenerator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 682b56d4654bea3de8b383036947492f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Generators/IslandGenerator.cs b/Assets/Generators/IslandGenerator.cs deleted file mode 100644 index 5a9fef2..0000000 --- a/Assets/Generators/IslandGenerator.cs +++ /dev/null @@ -1,29 +0,0 @@ -using UnityEngine; - -namespace Generators -{ - public class IslandGenerator : IGenerator - { - private IGenerator noise; - - public float Inner { get; set; } = 20; - public float Outer { get; set; } = 23; - - public float Threshold { get; set; } = .5f; - - public IslandGenerator(IGenerator noise) - { - this.noise = noise; - } - - public double GetValue(Vector2 position) - { - var distance = position.magnitude / 10; - distance = (distance - Inner) / (Outer - Inner); - - var result = noise.GetValue(position) + .75 * (Mathf.Clamp(0, distance, 1) - 1); - - return result > Threshold ? 1 : 0; - } - } -} \ No newline at end of file diff --git a/Assets/Generators/PerlinNoiseGenerator.cs b/Assets/Generators/PerlinNoiseGenerator.cs deleted file mode 100644 index 28c671a..0000000 --- a/Assets/Generators/PerlinNoiseGenerator.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine; - -namespace Generators -{ - public class PerlinNoiseGenerator : IGenerator - { - public float Scale { get; set; } = 0.001f; - public Vector2 Offset { get; set; } = new Vector2(.0f, .0f); - public int Iterations { get; set; } = 8; - public float Decay { get; set; } = .7f; - public float Lacunarity { get; set; } = 1.71f; - - public double GetValue(Vector2 position) - { - var amplitude = 1.0; - var scale = Scale; - var result = 0.0; - - for (int i = 0; i < Iterations; i++) { - result += amplitude * Calculate(position, scale); - - amplitude *= Decay; - scale *= Lacunarity; - } - - return result / ((1 - System.Math.Pow(Decay, Iterations)) / (1 - Decay)); - } - - private double Calculate(Vector2 position, float scale) - { - var final = (position + Offset) * scale; - - return Mathf.PerlinNoise(final.x, final.y); - } - } -} \ No newline at end of file diff --git a/Assets/Generators/PerlinNoiseGenerator.cs.meta b/Assets/Generators/PerlinNoiseGenerator.cs.meta deleted file mode 100644 index d564429..0000000 --- a/Assets/Generators/PerlinNoiseGenerator.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 80853afcc172aecd3bc2885e9c1f4705 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Map.meta b/Assets/Map.meta deleted file mode 100644 index 0aa451d..0000000 --- a/Assets/Map.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b2de5bc0563442539a60e5a00687d27d -timeCreated: 1564082962 \ No newline at end of file diff --git a/Assets/Map/Location.cs.meta b/Assets/Map/Location.cs.meta deleted file mode 100644 index 8732477..0000000 --- a/Assets/Map/Location.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: c1829eb593684199a5177fd08c07a753 -timeCreated: 1564083223 \ No newline at end of file diff --git a/Assets/Map/LocationGenerator.cs.meta b/Assets/Map/LocationGenerator.cs.meta deleted file mode 100644 index 1c1c5b6..0000000 --- a/Assets/Map/LocationGenerator.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 7a2d1705444344bfa99efc3c210db6f4 -timeCreated: 1564324021 \ No newline at end of file diff --git a/Assets/Map/Map.cs.meta b/Assets/Map/Map.cs.meta deleted file mode 100644 index 7d9379e..0000000 --- a/Assets/Map/Map.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d1d1ebae421749529153eedaa70e227b -timeCreated: 1564082971 \ No newline at end of file diff --git a/Assets/SampleScenes.meta b/Assets/SampleScenes.meta deleted file mode 100644 index fadfba8..0000000 --- a/Assets/SampleScenes.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3d8829ac873af27488b1412b8db301ab -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/CityGenerator.cs b/Assets/Scripts/CityGenerator.cs index 5d82b77..c00091a 100644 --- a/Assets/Scripts/CityGenerator.cs +++ b/Assets/Scripts/CityGenerator.cs @@ -1,11 +1,8 @@ using Assets.Common; -using Assets.Map; using Assets.Voronoi; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Assets.Scripts @@ -100,7 +97,7 @@ namespace Assets.Scripts public bool displayWorldRoads = false; } - [RequireComponent(typeof(GraphGenerator))] + [RequireComponent(typeof(LandmassGenerator))] public class CityGenerator : MonoBehaviour { private System.Random _random; @@ -185,8 +182,7 @@ namespace Assets.Scripts { var randomLocation = _locationGraph.Vertices[_random.Next(1, _locationGraph.Vertices.Count())]; var count = randomLocation.Sites.Count(); - Site randomPoint; - randomPoint = randomLocation.Sites[_random.Next(0, count)]; + var randomPoint = randomLocation.Sites[_random.Next(0, count)]; vertices.Add(randomPoint.Index); } return vertices; @@ -309,7 +305,7 @@ namespace Assets.Scripts public void Reset() { - var graphGenerator = GetComponent(); + var graphGenerator = GetComponent(); _random = new System.Random(graphGenerator.seed); cities = new List(); } @@ -321,7 +317,7 @@ namespace Assets.Scripts public void Generate() { - var graphGenerator = GetComponent(); + var graphGenerator = GetComponent(); graphGenerator.Generate(); _basicGraph = graphGenerator.VoronoiGenerator.Delaunay.Morph(l => l); _voronoiGraph = graphGenerator.VoronoiGenerator.Voronoi; diff --git a/Assets/Scripts/ForestGenerator.cs b/Assets/Scripts/ForestGenerator.cs index 5ec5dd0..8b8ec09 100644 --- a/Assets/Scripts/ForestGenerator.cs +++ b/Assets/Scripts/ForestGenerator.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; using System.Linq; using Assets.Common; -using Assets.Generators; -using Assets.Map; +using Assets.PointDistribution; using Assets.Voronoi; using UnityEngine; using Random = System.Random; @@ -11,7 +10,7 @@ namespace Assets { [RequireComponent(typeof(MeshFilter))] [RequireComponent(typeof(MeshRenderer))] - [RequireComponent(typeof(GraphGenerator))] + [RequireComponent(typeof(LandmassGenerator))] public class ForestGenerator : MonoBehaviour { public GameObject[] trees; @@ -22,7 +21,7 @@ namespace Assets private Random _random = new Random(); private List _sites; - private GraphGenerator Generator => GetComponent(); + private LandmassGenerator Generator => GetComponent(); public void Generate() { diff --git a/Assets/Scripts/GraphGenerator.cs b/Assets/Scripts/LandmassGenerator.cs similarity index 98% rename from Assets/Scripts/GraphGenerator.cs rename to Assets/Scripts/LandmassGenerator.cs index c6c97bf..f82df23 100644 --- a/Assets/Scripts/GraphGenerator.cs +++ b/Assets/Scripts/LandmassGenerator.cs @@ -3,8 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using Assets.Common; -using Assets.Generators; -using Assets.Map; +using Assets.PointDistribution; using Assets.Voronoi; using UnityEditor; using UnityEngine; @@ -50,7 +49,7 @@ namespace Assets }; [ExecuteInEditMode] - public class GraphGenerator : MonoBehaviour + public class LandmassGenerator : MonoBehaviour { private PoissonDiskSampler _sampler; private Random _random; @@ -88,7 +87,7 @@ namespace Assets public void Reset() { - _random = new System.Random(seed); + _random = new Random(seed); _sampler = new PoissonDiskSampler(radius); _sampler.Generator = _random; diff --git a/Assets/Scripts/GraphGenerator.cs.meta b/Assets/Scripts/LandmassGenerator.cs.meta similarity index 100% rename from Assets/Scripts/GraphGenerator.cs.meta rename to Assets/Scripts/LandmassGenerator.cs.meta diff --git a/Assets/Scripts/MapRenderer.cs b/Assets/Scripts/MapRenderer.cs index 8ae09f2..32fbe5f 100644 --- a/Assets/Scripts/MapRenderer.cs +++ b/Assets/Scripts/MapRenderer.cs @@ -1,8 +1,6 @@ -using System; using System.Collections.Generic; using System.Linq; using Assets.Common; -using Assets.Map; using UnityEngine; using Random = UnityEngine.Random; @@ -10,7 +8,7 @@ namespace Assets { [RequireComponent(typeof(MeshFilter))] [RequireComponent(typeof(MeshRenderer))] - [RequireComponent(typeof(GraphGenerator))] + [RequireComponent(typeof(LandmassGenerator))] public class MapRenderer : MonoBehaviour { public float UVScale = 1.0f; @@ -25,7 +23,7 @@ namespace Assets public void Generate() { - var graph = GetComponent(); + var graph = GetComponent(); graph.Reset(); graph.Generate(); @@ -179,7 +177,7 @@ namespace Assets private void OnDrawGizmos() { - var graph = GetComponent(); + var graph = GetComponent(); if (graph?.LocationGenerator?.Result == null) return; diff --git a/Assets/Scripts/PointDistribution.meta b/Assets/Scripts/PointDistribution.meta new file mode 100644 index 0000000..ab0430e --- /dev/null +++ b/Assets/Scripts/PointDistribution.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 72849a31bf1649faa230ac49f1df4d57 +timeCreated: 1573303680 \ No newline at end of file diff --git a/Assets/Scripts/PointDistribution/IPointDistribution.cs b/Assets/Scripts/PointDistribution/IPointDistribution.cs new file mode 100644 index 0000000..4e2309b --- /dev/null +++ b/Assets/Scripts/PointDistribution/IPointDistribution.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using Assets.Common; + +namespace Assets.PointDistribution +{ + public interface IPointDistribution + { + IEnumerable Generate(float width, float height); + } +} \ No newline at end of file diff --git a/Assets/Scripts/PointDistribution/IPointDistribution.cs.meta b/Assets/Scripts/PointDistribution/IPointDistribution.cs.meta new file mode 100644 index 0000000..eaa1528 --- /dev/null +++ b/Assets/Scripts/PointDistribution/IPointDistribution.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 05c83e14e4294176bfcbac0e8b8f1018 +timeCreated: 1573303566 \ No newline at end of file diff --git a/Assets/Generators/PoissonDiskSampler.cs b/Assets/Scripts/PointDistribution/PoissonDiskSampler.cs similarity index 94% rename from Assets/Generators/PoissonDiskSampler.cs rename to Assets/Scripts/PointDistribution/PoissonDiskSampler.cs index 3e9f55b..c424504 100644 --- a/Assets/Generators/PoissonDiskSampler.cs +++ b/Assets/Scripts/PointDistribution/PoissonDiskSampler.cs @@ -4,9 +4,9 @@ using System.Linq; using Assets.Common; using UnityEngine; -namespace Assets.Generators +namespace Assets.PointDistribution { - public class PoissonDiskSampler + public class PoissonDiskSampler : IPointDistribution { public System.Random Generator { get; set; } = new System.Random(); @@ -53,11 +53,11 @@ namespace Assets.Generators var x = (int)Math.Floor(point.x / size); var y = (int)Math.Floor(point.y / size); - var neighbours = (new List<(int, int)>() { + var neighbours = new List<(int, int)> { (x - 1, y + 1), (x, y + 1), (x + 1, y + 1), (x - 1, y), (x, y), (x + 1, y), (x - 1, y - 1), (x, y - 1), (x + 1, y - 1) - }); + }; return neighbours .Where(p => grid.ContainsKey(p)) diff --git a/Assets/Generators/PoissonDiskSampler.cs.meta b/Assets/Scripts/PointDistribution/PoissonDiskSampler.cs.meta similarity index 100% rename from Assets/Generators/PoissonDiskSampler.cs.meta rename to Assets/Scripts/PointDistribution/PoissonDiskSampler.cs.meta diff --git a/Assets/Tools/TikzExporter.cs b/Assets/Tools/TikzExporter.cs new file mode 100644 index 0000000..1a6a1eb --- /dev/null +++ b/Assets/Tools/TikzExporter.cs @@ -0,0 +1,10 @@ +namespace Assets.Tools +{ + public class TikzGenerator + { + public static void Main() + { + + } + } +} \ No newline at end of file diff --git a/Assets/Generators/IslandGenerator.cs.meta b/Assets/Tools/TikzExporter.cs.meta similarity index 83% rename from Assets/Generators/IslandGenerator.cs.meta rename to Assets/Tools/TikzExporter.cs.meta index 19d5c0e..38eab7c 100644 --- a/Assets/Generators/IslandGenerator.cs.meta +++ b/Assets/Tools/TikzExporter.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bbd6867fa0c423e078e554a9835c397f +guid: 3517404de0c3a15dd8b56257c07ac43a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Voronoi/VoronoiGenerator.cs b/Assets/Voronoi/VoronoiGenerator.cs index 9c6722b..7ee78ca 100644 --- a/Assets/Voronoi/VoronoiGenerator.cs +++ b/Assets/Voronoi/VoronoiGenerator.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; using Assets.Common; -using Assets.Map; using Priority_Queue; namespace Assets.Voronoi