- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user