v. 1.06
This commit is contained in:
parent
d778014e92
commit
162c051b09
49
Tractor.py
49
Tractor.py
@ -1,10 +1,14 @@
|
||||
from Main.TractorLoad import TractorTrailer
|
||||
from Main.constants import HORIZONTAL_TILES_NUMBER, VERTICAL_TILES_NUMBER
|
||||
|
||||
|
||||
class Tractor:
|
||||
def __init__(self, horizontal_index, vertical_index, hitch, header, fuel_tank):
|
||||
self.horizontal_index = horizontal_index
|
||||
self.vertical_index = vertical_index
|
||||
self.hitch = hitch
|
||||
self.header = header
|
||||
self.fuel_tank = fuel_tank
|
||||
def __init__(self, __horizontal_index, __vertical_index, __hitch, __header, __fuel_tank):
|
||||
self.__horizontal_index = __horizontal_index
|
||||
self.__vertical_index = __vertical_index
|
||||
self.__hitch = __hitch
|
||||
self.__header = __header
|
||||
self.__fuel_tank = __fuel_tank
|
||||
|
||||
@property
|
||||
def horizontal_index(self):
|
||||
@ -12,36 +16,47 @@ class Tractor:
|
||||
|
||||
@horizontal_index.setter
|
||||
def horizontal_index(self, horizontal_index):
|
||||
self.__horizontal_index = horizontal_index
|
||||
|
||||
if self.__horizontal_index < 1 or self.__horizontal_index >= HORIZONTAL_TILES_NUMBER - 1:
|
||||
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
|
||||
|
||||
if self.__vertical_index < 1 or self.__vertical_index >= VERTICAL_TILES_NUMBER - 1:
|
||||
self.__vertical_index = vertical_index
|
||||
|
||||
@property
|
||||
def hitch(self):
|
||||
return self.__hitch
|
||||
|
||||
@hitch.setter
|
||||
def hitch(self, hitch):
|
||||
self.__hitch = hitch
|
||||
|
||||
if hitch is "Tillage unit" or "Crop Trailer" or TractorTrailer or "Nothing":
|
||||
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
|
||||
|
||||
def __fuel_tank(self, fuel_tank):
|
||||
if 0 < fuel_tank < 100:
|
||||
self.__fuel_tank = fuel_tank
|
||||
|
||||
def fill_tank(self):
|
||||
self.__fuel_tank(100)
|
||||
|
||||
def reduce_fuel(self):
|
||||
if 0 < self.fuel_tank < 100:
|
||||
self.__fuel_tank = self.__fuel_tank - 1
|
||||
|
||||
@property
|
||||
def header(self):
|
||||
return self.__header
|
||||
|
||||
@header.setter
|
||||
def header(self, header):
|
||||
self.__header = header
|
||||
if header is True or False:
|
||||
self.__header = header
|
||||
|
12
TractorLoad.py
Normal file
12
TractorLoad.py
Normal file
@ -0,0 +1,12 @@
|
||||
class TractorTrailer:
|
||||
def __init__(self, __load):
|
||||
self.__load = __load
|
||||
|
||||
@property
|
||||
def load(self):
|
||||
return self.__load
|
||||
|
||||
@load.setter
|
||||
def load(self, load):
|
||||
if self.__load is "Fertilizer" or "Seeds" or "Water":
|
||||
self.__load = load
|
Loading…
Reference in New Issue
Block a user