import engine import rooms def main(): t = rooms.TestRoom() print t if __name__ == "__main__": # this part main() # #GET # #DROP # #USE # GO # QUIT # STATUS class Game(object): def __init__(self): # Standards for room names self.roomList = {"North Hall": NorthHall(), "South Hall": SouthHall(), "Test Room": TestRoom()} self.currentRoom = roomList["Test Room"] def __repr__(self): rstring = str(self.currentRoom) + "\n" rstring += self.currentRoom.exitsString() def getInput(self): i = raw_input("> ") # > VERB NOUN i = i.lower return i.split() # ["VERB", "NOUN"] def move(self, direction): # arg direction is a direction string newRoom = self.currentRoom.getExitDirection(direction) if newRoom: self.currentRoom = roomList[newRoom] def useItem(self, item): pass def getItem(self, item): pass def dropItem(self, item): pass def quitGame(self, item): # Maybe import sys later quit() def mainLoop(self): print self commandList = {"go": self.move, "quit": self.quitGame} userInput = self.getInput() verb = userInput[0] if len(userInput) > 1: noun = userInput[1] else: noun = None if verb in commandList: if noun: commandList(noun) else: commandList() else: print("I do not understand %s" % verb