AI_PRO/Field.py
2021-04-27 19:36:48 +02:00

34 lines
979 B
Python

class Field:
def __init__(self, horizontal_index, vertical_index, state, cost):
self.__horizontal_index = horizontal_index
self.__vertical_index = vertical_index
self.__state = state
self.__cost = cost
@property
def state(self):
return self.__state
@property
def cost(self):
return self.__cost
@property
def horizontal_index(self):
return self.__horizontal_index
@property
def vertical_index(self):
return self.__vertical_index
@state.setter
def state(self, state):
if state == "toPlow" or state == "toWater" or state == "toSeed" or \
state == "toFertilize" or state == "toCut" or state == "TOOLS_FIELD" or state == "FUEL_FIELD":
self.__state = state
@cost.setter
def cost(self, cost):
if cost == 1 or cost == 2 or cost == 3 or \
cost == 4 or cost == 5 or cost == 0:
self.__cost = cost