start windows
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from Enums import DIRECTION
|
||||
from utils.Enums import DIRECTION
|
||||
from gdpc import Editor, Block, geometry
|
||||
from buildings.geometry.Tile import Tile
|
||||
from buildings.geometry.Point import Point
|
||||
@@ -70,7 +70,7 @@ class Polygon:
|
||||
def set_vertices_and_neighbors(self, tiles : list[Tile], vertices : list[Vertice]):
|
||||
for tile in tiles:
|
||||
targets = tile.get_neighbors_coords()
|
||||
for vertice_num,target in enumerate(targets):
|
||||
for vertice_num,target in utils.Enumerate(targets):
|
||||
has_neighbor = self._has_neighbor(target, tiles)
|
||||
if not has_neighbor:
|
||||
vertice = tile.get_vertice(vertice_num)
|
||||
|
||||
@@ -9,6 +9,9 @@ class Rectangle:
|
||||
def get_position(self):
|
||||
return (self.point1.position, self.point2.position)
|
||||
|
||||
def fill(self,editor : Editor, material : str, y : int, y2 : int = None):
|
||||
def fill(self,editor : Editor, material : str, y : int, y2 : int = None, xpadding : int = 0, zpadding : int = 0):
|
||||
if self.point2.x - self.point1.x < 2*xpadding: xpadding = 0
|
||||
if self.point2.z - self.point1.z < 2*zpadding: zpadding = 0
|
||||
if y2 == None: y2 = y
|
||||
geometry.placeCuboid(editor, (self.point1.x, y, self.point1.z), (self.point2.x, y2, self.point2.z), Block(material))
|
||||
|
||||
geometry.placeCuboid(editor, (self.point1.x+xpadding, y, self.point1.z+zpadding), (self.point2.x-xpadding, y2, self.point2.z-zpadding), Block(material))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from gdpc import Editor, Block, geometry
|
||||
from Enums import DIRECTION
|
||||
from utils.Enums import DIRECTION
|
||||
from buildings.geometry.Point import Point
|
||||
from buildings.geometry.Vertice import Vertice
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from Enums import DIRECTION
|
||||
from utils.Enums import DIRECTION
|
||||
from buildings.geometry.Point import Point
|
||||
from buildings.geometry.Rectangle import Rectangle
|
||||
|
||||
class Vertice(Rectangle):
|
||||
def __init__(self, point1 : Point, point2 : Point, facing : str):
|
||||
def __init__(self, point1 : Point, point2 : Point, facing : DIRECTION):
|
||||
Rectangle.__init__(self, point1, point2)
|
||||
self.facing = facing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user