Skip to content

Commit

Permalink
Add docstring to bfs_walk
Browse files Browse the repository at this point in the history
  • Loading branch information
bcollazo committed Jul 6, 2021
1 parent 4f43341 commit 59062b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions catanatron/models/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ def build_settlement(self, color, node_id, initial_build_phase=False):
return previous_road_color, self.road_color, self.road_lengths

def bfs_walk(self, node_id, color):
"""Generates set of nodes that are "connected" to given node.
Args:
node_id (int): Where to start search/walk.
color (Color): Player color asking
Returns:
Set[int]: Nodes that are "connected" to this one
by roads of the color player.
"""
agenda = [node_id] # assuming node_id is owned.
visited = set()

Expand Down

0 comments on commit 59062b3

Please sign in to comment.