Skip to content

Commit

Permalink
fix docstring of world module.
Browse files Browse the repository at this point in the history
  • Loading branch information
srajan-kiyotaka committed Jun 17, 2024
1 parent ad13204 commit 2dd8d83
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions traverseCraft/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class CreateTreeWorld:
- textSize (int): The font size of the button text. Default is 24.
- textWeight (str): The font weight of the button text. Default is "bold".
- buttonText (str): The text displayed on the buttons. Default is "Start Agent".
- logoPath (str, optional): The file path to the logo image. Default is "design 1.png".
- logoPath (str, optional): The file path to the logo image. Default is traverseCraft logo.
Attributes:
- worldID (str): Class identifier for the tree world.
Expand Down Expand Up @@ -930,7 +930,7 @@ class CreateGraphWorld:
- textSize (int): The font size of the button text. Default is 24.
- textWeight (str): The font weight of the button text. Default is "bold".
- buttonText (str): The text displayed on the buttons. Default is "Start Agent".
- logoPath (str, optional): The file path to the logo image. Default is "design 1.png".
- logoPath (str, optional): The file path to the logo image. Default is traverseCraft logo.
Attributes:
- worldID (str): Class identifier for the graph world.
Expand Down Expand Up @@ -1013,7 +1013,7 @@ def __init__(self, worldName: str, worldInfo: dict, radius: int = 20, fontSize:i
self._canvas = Canvas(self._root, width=self._width, height=self._height, bg="white")
self._canvas.pack()
self.nodeMap = {}
## Construct Tree Data Structure ##
## Construct Graph Data Structure ##
if("edges" not in self._worldInfo):
self._worldInfo['edges'] = None
if("vals" not in self._worldInfo):
Expand Down Expand Up @@ -1203,7 +1203,7 @@ def _generateGraphDS(self, adj, rootId, parentId=None, edges=None, values=None,

def constructWorld(self):
"""
Constructs the tree world.
Constructs the graph world.
Parameters:
self (World): The World instance.
Expand Down Expand Up @@ -1254,10 +1254,10 @@ def _drawEdges(self, node):

def _drawNodes(self, node):
"""
Draw the nodes in the tree.
Draw the nodes in the graph.
Parameters:
node (TreeNode): The node to draw.
node (GraphNode): The node to draw.
Returns:
None
"""
Expand Down Expand Up @@ -1295,15 +1295,15 @@ def _drawNodes(self, node):

def _addStartButton(self):
"""
Add the "Start Agent" button to the tree world.
Add the "Start Agent" button to the graph world.
Parameters:
None
Returns:
None
"""
# Find the bottommost point of the tree
# Find the bottommost point of the graph
button_y = 100 + max(y for _, y in self._position.values())
button_x = (min(x for x, _ in self._position.values()) + max(x for x, _ in self._position.values())) // 2

Expand All @@ -1314,7 +1314,7 @@ def _addStartButton(self):

def changeNodeColor(self, nodeId, color):
"""
Changes the color of a node in the tree.
Changes the color of a node in the graph.
Args:
nodeId (int): The ID of the node to change the color of.
Expand All @@ -1330,7 +1330,7 @@ def changeNodeColor(self, nodeId, color):

def changeNodeText(self, nodeId, newText):
"""
Changes the text of a node in the tree.
Changes the text of a node in the graph.
Parameters:
nodeId (int): The ID of the node to change the text of.
Expand Down

0 comments on commit 2dd8d83

Please sign in to comment.