-
Notifications
You must be signed in to change notification settings - Fork 0
/
base_classes.py
50 lines (37 loc) · 1.09 KB
/
base_classes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class Room:
def __init__(self, id_: str, name: str, description: str, exits_list: list, requires_key):
self.id_ = id_
self.name = name
self.description = description
self.exits_list = exits_list
self.requires_key = requires_key
self.exits = []
def init_exits(self, exits: list):
self.exits = exits
class Player:
def __init__(self, name, current_room):
self.name = name
self.hp = 10
self.current_room = current_room
def input_handler(self, command):
if "walk" in [cmd.lower() for cmd in command.split()]:
pass
def walk(self, new_room):
self.current_room = new_room
# if room_name in room_layout[self.position]:
# self.position = room_name
# else:
# print('No such room')
# return False
class Inventory:
items = []
def __init__(self):
pass
def remove_item(self):
pass
def use_item(self):
pass
class Item:
def __init__(self, name):
self.name = name
self.description = ''