Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # room Class Part1end
- class Room():
- def __init__(self, room_name):
- self.name = room_name
- self.description = None
- self.linked_rooms = {}
- def set_description(self, room_description):
- self.description = room_description
- def get_name(self):
- return self.name
- def set_name(self, room_name):
- self.name = room_name
- def describe(self):
- print( self.description )
- def link_room(self, room_to_link, direction):
- self.linked_rooms[direction] = room_to_link
- def get_details(self):
- print(" ")
- print("The " + self.name)
- print("--------------------------")
- print(self.description)
- print(" ")
- for direction in self.linked_rooms:
- room = self.linked_rooms[direction]
- print( "The " + room.get_name() + " is " + direction)
- def move(self, direction):
- if direction in self.linked_rooms:
- return self.linked_rooms[direction]
- else:
- print("You can't go that way")
- return self
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement