23 lines
671 B
Python
23 lines
671 B
Python
from project_constants import Terrain as t
|
|
|
|
#Assume_cost function assumes colour as an argument (colour that is already given to a tile) and depending
|
|
#on what it is returns value of Terrein Enum
|
|
#It is used in Tile.cost (giving the value to the tile)
|
|
|
|
|
|
def assume_cost(color):
|
|
if (color == "BLUE"):
|
|
return t.CONCRETE
|
|
elif (color == "GREEN"):
|
|
return t.GRASS
|
|
elif (color == "ORANGE"):
|
|
return t.MUD
|
|
|
|
|
|
class Tile:
|
|
def __init__(self, position, color=None, mine=None):
|
|
self.position = position
|
|
self.color = color
|
|
self.cost = assume_cost(color)
|
|
# mine is an instance of Mine class
|
|
self.mine = mine |