diff --git a/farm/Field_Representation.py b/farm/Field_Representation.py index eb8494f..f47d98f 100644 --- a/farm/Field_Representation.py +++ b/farm/Field_Representation.py @@ -20,7 +20,15 @@ ARROW_RIGHT = 10 ROCK_1 = 11 ROCK_2 = 12 ROCK_3 = 13 +BURGER = 14 +PAB1 = 15 +GOLDBAR = 16 MAGINENT = 21 +CHEMTRANT = 22 +TENESENT = 23 +CIBUTRANT = 24 +ARTISENT = 25 + class Field: data_value_grid = [] @@ -40,6 +48,9 @@ class Field: colors.append(RED) colors.append(PINK) colors.append(MAGINENT) + colors.append(CHEMTRANT) + colors.append(TENESENT) + colors.append(CIBUTRANT) def __init__(self): @@ -75,8 +86,13 @@ class Field: ROCK_1: cv.imread("rock1.jpg", cv.IMREAD_COLOR), ROCK_2: cv.imread("rock2.jpg", cv.IMREAD_COLOR), ROCK_3: cv.imread("rock3.jpg", cv.IMREAD_COLOR), - MAGINENT: cv.imread("maginent.jpg", cv.IMREAD_COLOR) - + BURGER: cv.imread("burger.jpg", cv.IMREAD_COLOR), + GOLDBAR: cv.imread("burger.jpg", cv.IMREAD_COLOR), + PAB1: cv.imread("pab1.jpg", cv.IMREAD_COLOR), + MAGINENT: cv.imread("maginent.jpg", cv.IMREAD_COLOR), + CHEMTRANT: cv.imread("chemtrant.jpg", cv.IMREAD_COLOR), + TENESENT: cv.imread("tenesent.jpg", cv.IMREAD_COLOR), + CIBUTRANT: cv.imread("cibutrant.jpg", cv.IMREAD_COLOR) } def reset(self): @@ -349,7 +365,7 @@ class Field: if state[e, i] == color and state[e, i + 1] == color: # third left upper if e - 1 >= 0 and i - 1 >= 0: - if state[e - 1, i - 1] == color and (state[e, i - 1] >= 1 and state[e, i - 1] <= 5): + if state[e - 1, i - 1] == color and (state[e, i - 1] in self.colors): print("upper left", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e - 1, i - 1]) dest_pt = self.get_click_point(self.data_coordinates[e, i - 1]) @@ -357,7 +373,7 @@ class Field: return True # third left lower if e + 1 <= 7 and i - 1 >= 0: - if state[e + 1, i - 1] == color and (state[e, i - 1] >= 1 and state[e, i - 1] <= 5): + if state[e + 1, i - 1] == color and (state[e, i - 1] in self.colors): print("lower left", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e + 1, i - 1]) dest_pt = self.get_click_point(self.data_coordinates[e, i - 1]) @@ -365,7 +381,7 @@ class Field: return True # third left with gap if i - 2 >= 0: - if state[e, i - 2] == color and (state[e, i - 1] >= 1 and state[e, i - 1] <= 5): + if state[e, i - 2] == color and (state[e, i - 1] in self.colors): print("left gap ", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e, i - 2]) dest_pt = self.get_click_point(self.data_coordinates[e, i - 1]) @@ -373,7 +389,7 @@ class Field: return True # third right upper if e - 1 >= 0 and i + 2 <= 13: - if state[e - 1, i + 2] == color and (state[e, i + 2] >= 1 and state[e, i + 2] <= 5): + if state[e - 1, i + 2] == color and (state[e, i + 2] in self.colors): print("upper right", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e - 1, i + 2]) dest_pt = self.get_click_point(self.data_coordinates[e, i + 2]) @@ -381,7 +397,7 @@ class Field: return True # third right lower if e + 1 <= 7 and i + 2 <= 13: - if state[e + 1, i + 2] == color and (state[e, i + 2] >= 1 and state[e, i + 2] <= 5): + if state[e + 1, i + 2] == color and (state[e, i + 2] in self.colors): print("upper lower", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e + 1, i + 2]) dest_pt = self.get_click_point(self.data_coordinates[e, i + 2]) @@ -390,7 +406,7 @@ class Field: # third right with gap if i + 3 <= 13: - if state[e, i + 3] == color and (state[e, i + 2] >= 1 and state[e, i + 2] <= 5): + if state[e, i + 3] == color and (state[e, i + 2] in self.colors): print("right gap ", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e, i + 3]) dest_pt = self.get_click_point(self.data_coordinates[e, i + 2]) @@ -405,7 +421,7 @@ class Field: if state[e, i] == color and state[e + 1, i] == color: # third left upper if e - 1 >= 0 and i - 1 >= 0: - if state[e - 1, i - 1] == color and (state[e - 1, i] >= 1 and state[e - 1, i] <= 5): + if state[e - 1, i - 1] == color and (state[e - 1, i] in self.colors): print("upper left", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e - 1, i - 1]) dest_pt = self.get_click_point(self.data_coordinates[e - 1, i]) @@ -413,7 +429,7 @@ class Field: return True # third left lower if e + 2 <= 7 and i - 1 >= 0: - if state[e + 2, i - 1] == color and (state[e + 2, i] >= 1 and state[e + 2, i] <= 5): + if state[e + 2, i - 1] == color and (state[e + 2, i] in self.colors): print("lower left", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e + 2, i - 1]) dest_pt = self.get_click_point(self.data_coordinates[e + 2, i]) @@ -421,7 +437,7 @@ class Field: return True # third right upper if e - 1 >= 0 and i + 1 <= 13: - if state[e - 1, i + 1] == color and (state[e - 1, i] >= 1 and state[e - 1, i] <= 5): + if state[e - 1, i + 1] == color and (state[e - 1, i] in self.colors): print("upper right", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e - 1, i + 1]) dest_pt = self.get_click_point(self.data_coordinates[e - 1, i]) @@ -429,7 +445,7 @@ class Field: return True # third right lower if e + 2 <= 7 and i + 1 <= 13: - if state[e + 2, i + 1] == color and (state[e + 2, i] >= 1 and state[e + 2, i] <= 5): + if state[e + 2, i + 1] == color and (state[e + 2, i] in self.colors): print("upper lower", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e + 2, i + 1]) dest_pt = self.get_click_point(self.data_coordinates[e + 2, i]) @@ -437,7 +453,7 @@ class Field: return True # third upper with gap if e - 2 >= 0: - if state[e - 2, i] == color and (state[e - 1, i] >= 1 and state[e - 1, i] <= 5): + if state[e - 2, i] == color and (state[e - 1, i] in self.colors): print("upper gap ", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e - 2, i]) dest_pt = self.get_click_point(self.data_coordinates[e - 1, i]) @@ -445,7 +461,7 @@ class Field: return True # third lower with gap if e + 3 <= 7: - if state[e + 3, i] == color and (state[e + 2, i] >= 1 and state[e + 2, i] <= 5): + if state[e + 3, i] == color and (state[e + 2, i] in self.colors): print("lower gap ", color, e, i) src_pt = self.get_click_point(self.data_coordinates[e + 3, i]) dest_pt = self.get_click_point(self.data_coordinates[e + 2, i]) diff --git a/farm/bigbomb.jpg b/farm/bigbomb.jpg index e336b41..492214f 100644 Binary files a/farm/bigbomb.jpg and b/farm/bigbomb.jpg differ diff --git a/farm/burger.jpg b/farm/burger.jpg new file mode 100644 index 0000000..0c8a2ed Binary files /dev/null and b/farm/burger.jpg differ diff --git a/farm/chemtrant.jpg b/farm/chemtrant.jpg new file mode 100644 index 0000000..6dd84b7 Binary files /dev/null and b/farm/chemtrant.jpg differ diff --git a/farm/cibutrant.jpg b/farm/cibutrant.jpg new file mode 100644 index 0000000..82e619b Binary files /dev/null and b/farm/cibutrant.jpg differ diff --git a/farm/goldbar.jpg b/farm/goldbar.jpg new file mode 100644 index 0000000..2d85155 Binary files /dev/null and b/farm/goldbar.jpg differ diff --git a/farm/pab1.jpg b/farm/pab1.jpg new file mode 100644 index 0000000..6920935 Binary files /dev/null and b/farm/pab1.jpg differ diff --git a/farm/rock1.jpg b/farm/rock1.jpg index c292365..a172548 100644 Binary files a/farm/rock1.jpg and b/farm/rock1.jpg differ diff --git a/farm/rock1.png b/farm/rock1.png new file mode 100644 index 0000000..26b0945 Binary files /dev/null and b/farm/rock1.png differ diff --git a/farm/tenesent.jpg b/farm/tenesent.jpg new file mode 100644 index 0000000..adf9923 Binary files /dev/null and b/farm/tenesent.jpg differ