2022-04-19 07:49:45 +00:00
|
|
|
import House
|
|
|
|
import Field
|
2022-04-04 06:16:33 +00:00
|
|
|
|
|
|
|
class Board(object):
|
|
|
|
|
2022-04-19 07:49:45 +00:00
|
|
|
""":version: 0.1
|
|
|
|
:author: Martin Putzlocher
|
2022-04-04 06:16:33 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
""" ATTRIBUTES
|
2022-04-19 07:49:45 +00:00
|
|
|
list_all_fields (private)
|
2022-04-04 06:16:33 +00:00
|
|
|
"""
|
|
|
|
|
2022-04-19 07:49:45 +00:00
|
|
|
def __init__(self, colors:list, number_of_players=4):
|
|
|
|
self.colors = colors
|
|
|
|
self.num_players = number_of_players
|
|
|
|
self._list_all_fields = list()
|
|
|
|
self.init_board()
|
|
|
|
|
2022-04-14 20:48:16 +00:00
|
|
|
def get_house_by_color(self, color = "black"):
|
2022-04-19 07:49:45 +00:00
|
|
|
"""Returns list of house fields of one color
|
|
|
|
|
|
|
|
:param string: color :
|
|
|
|
:param color: (Default value = "black")
|
|
|
|
:returns: House :
|
2022-04-14 20:48:16 +00:00
|
|
|
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
def init_board(self):
|
2022-04-19 07:49:45 +00:00
|
|
|
"""Initialize Board
|
|
|
|
|
|
|
|
|
|
|
|
:returns: author
|
2022-04-14 20:48:16 +00:00
|
|
|
|
|
|
|
"""
|
2022-04-19 07:49:45 +00:00
|
|
|
for n in range(self.num_players):
|
|
|
|
for i in range(10):
|
|
|
|
f = Field.Field(self, i, self.colors[n], house=False)
|
|
|
|
self._list_all_fields.append(f)
|
|
|
|
IDlist = [f.get_id() for f in self._list_all_fields]
|
|
|
|
print(IDlist)
|
|
|
|
|
|
|
|
|
2022-04-14 20:48:16 +00:00
|
|
|
|
|
|
|
def get_next_standard_field(self, current_field):
|
|
|
|
"""
|
|
|
|
|
2022-04-19 07:49:45 +00:00
|
|
|
:param Field: current_field :
|
|
|
|
:param current_field:
|
|
|
|
:returns: Field :
|
2022-04-14 20:48:16 +00:00
|
|
|
@author
|
2022-04-19 07:49:45 +00:00
|
|
|
|
2022-04-14 20:48:16 +00:00
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
def get_next_field_by_color(self, current_field, color = "black"):
|
|
|
|
"""
|
|
|
|
|
2022-04-19 07:49:45 +00:00
|
|
|
:param Field: current_field : Current field
|
|
|
|
:param string: color : Color of the stone requesting his next field.
|
|
|
|
:param current_field:
|
|
|
|
:param color: (Default value = "black")
|
|
|
|
:returns: Field :
|
2022-04-14 20:48:16 +00:00
|
|
|
@author
|
2022-04-19 07:49:45 +00:00
|
|
|
|
2022-04-14 20:48:16 +00:00
|
|
|
"""
|
2022-04-19 07:49:45 +00:00
|
|
|
curr_id = current_field.get_id()
|
|
|
|
|
2022-04-14 20:48:16 +00:00
|
|
|
|
2022-04-04 06:16:33 +00:00
|
|
|
|
|
|
|
|