- level generation refactoring: moved most of the generation logic to a static GaveGenerator class + some minor cleanup

- WIP method for splitting the voronoi cells to smaller ones and carving a small cave through them
This commit is contained in:
Regalis
2016-04-02 16:03:41 +03:00
parent 2a2ba80f9c
commit 39c9c78266
7 changed files with 745 additions and 557 deletions
@@ -117,6 +117,11 @@ namespace Voronoi2
}
}
public enum CellType
{
Solid, Empty, Edge, Path, Removed
}
public class VoronoiCell
{
public List<GraphEdge> edges;
@@ -126,6 +131,8 @@ namespace Voronoi2
public Body body;
public CellType CellType;
public Vector2 Translation;
public Vector2 Center
@@ -174,6 +181,16 @@ namespace Voronoi2
//bodies = new List<Body>();
this.site = site;
}
public bool IsPointInside(Vector2 point)
{
foreach (GraphEdge edge in edges)
{
if (MathUtils.LinesIntersect(point, Center, edge.point1, edge.point2)) return false;
}
return true;
}
}
public class GraphEdge