diff --git a/Main/Field.py b/Main/Field.py index 78a9fcd..4162935 100644 --- a/Main/Field.py +++ b/Main/Field.py @@ -1,5 +1,13 @@ class Field: - def __init__(self, horizontal, vertical, state): - self.horizontal = horizontal - self.vertical = vertical - self.state = state \ No newline at end of file + def __init__(self, __horizontal, __vertical, __state): + self.horizontal = __horizontal + self.vertical = __vertical + self.__state = __state + + @property + def state(self): + return self.__state + + @state.setter + def state(self, state): + self.__state = state diff --git a/Main/Tractor.py b/Main/Tractor.py index 70d248a..fecf20d 100644 --- a/Main/Tractor.py +++ b/Main/Tractor.py @@ -1,4 +1,47 @@ class Tractor: - def __init__(self, horizontal_index, vertical_index): + def __init__(self, horizontal_index, vertical_index, hitch, header, fuel_tank): self.horizontal_index = horizontal_index - self.vertical_index = vertical_index \ No newline at end of file + self.vertical_index = vertical_index + self.hitch = hitch + self.header = header + self.fuel_tank = fuel_tank + + @property + def horizontal_index(self): + return self.__horizontal_index + + @horizontal_index.setter + def horizontal_index(self, horizontal_index): + self.__horizontal_index = horizontal_index + + @property + def vertical_index(self): + return self.__vertical_index + + @vertical_index.setter + def vertical_index(self, vertical_index): + self.__vertical_index = vertical_index + + @property + def hitch(self): + return self.__hitch + + @hitch.setter + def hitch(self, hitch): + self.__hitch = hitch + + @property + def fuel_tank(self): + return self.__fuel_tank + + @fuel_tank.setter + def fuel_tank(self, fuel_tank): + self.__fuel_tank = fuel_tank + + @property + def header(self): + return self.__header + + @header.setter + def header(self, header): + self.__header = header \ No newline at end of file diff --git a/Main/constants.py b/Main/constants.py index a09d46c..c78d8dc 100644 --- a/Main/constants.py +++ b/Main/constants.py @@ -5,7 +5,7 @@ DISPLAY_SIZE_HORIZONTAL = 600 DISPLAY_SIZE_VERTICAL = 600 #TILE DIVIDER = TILE SIZE -TILE_SIZE = 50 +TILE_SIZE = 30 # number of tiles HORIZONTAL_TILES_NUMBER = DISPLAY_SIZE_HORIZONTAL/TILE_SIZE @@ -22,8 +22,6 @@ GREEN = (0, 255, 0) #DO SCIECIA #tractor const -TRACTOR_HORIZONTAL_LOCATION = DISPLAY_SIZE_HORIZONTAL/2 -TRACTOR_VERTICAL_LOCATION = DISPLAY_SIZE_VERTICAL/2 TRACTOR_WIDTH = TILE_SIZE TRACTOR_HEIGHT = TILE_SIZE diff --git a/Main/main.py b/Main/main.py index d6e7dd5..232cfaa 100644 --- a/Main/main.py +++ b/Main/main.py @@ -18,7 +18,7 @@ vertical_change = 0 board = Board.generate() -tractor = Tractor(horizontal_index=0, vertical_index=0) +tractor = Tractor(horizontal_index=0, vertical_index=0, hitch="nothing", header=False, fuel_tank=100) clock = pygame.time.Clock()