Skip to content

Commit

Permalink
debugging item
Browse files Browse the repository at this point in the history
  • Loading branch information
petmas2008 committed Nov 7, 2020
1 parent 5316b3f commit f3e5cbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions adventure/lib/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def __init__(self, name, weight, description, initial_location, initial_sublocat
self.initial_location = initial_location
self.initial_sublocation = initial_sublocation

def __repr__(self):
return "%s, %s" %(self.name, self.initial_location)

def __eq__(self, other):
return self.name == other.name

Expand All @@ -23,6 +26,9 @@ def __init__(self, name, description, is_initial):
self.exits = dict()
self.is_initial = (is_initial == "Yes")
self.inventory = set()

def __repr__(self):
return "%s, %s" %(self.name, self.inventory)

class Actor(base.DataBase):

Expand Down
3 changes: 2 additions & 1 deletion adventure/ui/text.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
def run(adventure):
while True:
print("You are in", adventure.player.location)
print(adventure.inventory)
print("You are in %r" % adventure.player.location)
print("You can go", adventure.player.location.exits)
print("You can get", adventure.player.location.inventory)
print("You have", adventure.player.inventory)
Expand Down

0 comments on commit f3e5cbb

Please sign in to comment.