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.

22 lines
657 B

import rooms
import items
class State:
def __init__(self):
self.current_room : rooms.Room = None
self.rooms : dict = {}
self.items : dict = {}
def switch_room(self, new_room):
self.current_room = new_room
def append_room(self, identifier : str, room: rooms.Room):
self.rooms[identifier] = room
def change_room(self, identifier : str, room: rooms.Room):
self.rooms[identifier] = room
def append_item(self, identifier : str, item: items.Item):
self.items[identifier] = item
def get_room(self, identifier : str):
return self.rooms[identifier]