-
Notifications
You must be signed in to change notification settings - Fork 1
/
inventory.py
42 lines (30 loc) · 1.05 KB
/
inventory.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
class inventory():
def __init__(self):
self.Items = []
self.Item_Selected = 0
self.Armor_Equiped = []
def add_item(self, item):
self.Items.append(item)
def get_items(self):
return self.Items
def get_index_of_item(self, item):
return self.Items.index(item)
def remove_item_index(self, index):
self.Items.pop(index)
def remove_item(self, item):
self.Items.pop(self.get_index_of_item(item))
def change_item_selected(self, index):
self.Item_Selected = index
def get_armor(self):
return self.Armor_Equiped
def get_armor_index(self, item):
return self.Armor_Equiped.index(item)
def get_add_armor(self, item):
self.Armor_Equiped(item)
def remove_armor(self, item):
self.Armor_Equiped.pop(self.get_armor_index(item))
def remove_armor_index(self, index):
self.Armor_Equiped.pop(index)
def add_loot(self, loot):
for item in loot:
self.add_item(item)