private static void AddRoof(InsideCheck.GridPosition position, IRoof roof) { List <IRoof> list = InsideCheck.AffirmRoofList(position); list.Add(roof); InsideCheck.ForceRefresh(position); }
public House(IDoor door, IWindow window, IRoof roof, IWall wall) { _door = door; _window = window; _roof = roof; _wall = wall; }
public static void RemoveRoof(IRoof roof) { if (InsideCheck._grid != null) { foreach (KeyValuePair <InsideCheck.GridPosition, InsideCheck.GridCell> keyValuePair in InsideCheck._grid) { InsideCheck.GridCell value = keyValuePair.Value; if (value.roofs != null) { for (int i = value.roofs.Count - 1; i >= 0; i--) { if (value.roofs[i] == roof) { value.roofs.RemoveAt(i); } } if (value.roofs.Count == 0) { value.roofs = null; } } } } }
public static void AddRoof(IRoof roof) { List <Vector3> polygon = roof.GetPolygon(); if (polygon.Count <= 0) { return; } Bounds bounds = new Bounds(polygon[0], Vector3.zero); for (int i = 1; i < polygon.Count; i++) { bounds.Encapsulate(polygon[i]); } InsideCheck.GridPosition gridPosition = InsideCheck.ToGridPosition(bounds.min); InsideCheck.GridPosition gridPosition2 = InsideCheck.ToGridPosition(bounds.max); for (int j = gridPosition.x; j <= gridPosition2.x; j++) { for (int k = gridPosition.y; k <= gridPosition2.y; k++) { InsideCheck.AddRoof(new InsideCheck.GridPosition(j, k), roof); } } }
public void SetRoof(IRoof roof) { this.roof = roof; }
private static bool IsRoofAbove(IRoof roof, Vector3 position) { return(roof.GetLevel() > position.y && MathEx.IsPointInPolygon(position, roof.GetPolygon())); }