You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
660 B

class Item:
def __init__(self, name):
self.name = name
class Arme(Item):
def __init__(self, name, stats_set):
super().__init__(name)
self.stats_set = stats_set
def equip():
pass
class Inventaire:
def __init__(self):
self.__content = []
def get_content(self):
return self.__content
def add_item(self, item):
if isinstance(Item, item):
self.__content.append(item)
return self
else:
raise ValueError("item attends un objet Item")
def remove_item(self, index):
self.__content.pop(index)
return self