added wall and roof class

This commit is contained in:
steev 2023-10-25 07:33:09 +02:00
parent b5364993aa
commit 502d501628
2 changed files with 29 additions and 2 deletions

View File

@ -1,2 +0,0 @@
# pyblock-exporer

29
wall.py Normal file
View File

@ -0,0 +1,29 @@
from pyblockworld import World
class Wall:
__length:int
__width:int
__height:int
__rotated:bool
__x:float
__y:float
__z:float
__world:World
__block:str
def __init__(self, x:float, y:float, z:float, block:str, world:World, length=10, width=10, height=5, rotated=False):
self.__width = width
self.__length = length
self.__height = height
self.__x = x
self.__y = y - 1
self.__z = z
self.__world = world
self.__rotated = rotated
self.__block = block
def build(self):
if self.__rotated:
self.__world.setBlocks(self.__x, self.__y, self.__z, self.__x + self.__width, self.__y + self.__height, self.__z, self.__block)
else:
self.__world.setBlocks(self.__x, self.__y, self.__z, self.__x, self.__y + self.__height, self.__z + self.__length, self.__block)