from Place import Place from AutoPerson import AutoPerson from Witch import Witch from Wizard import Wizard from Person import Person from Scroll import Scroll from Thief import Thief # Here we define the places in the imaginary world of Gack foodService = Place('food service') PO = Place('PO') alumniHall = Place('alumni hall') chamberOfWizards = Place('chamber of wizards') library = Place('library') goodShipOlin = Place('good ship Olin') lounge = Place('lounge') computerLab = Place('computer lab') offices = Place('offices') dormitory = Place('dormitory') pond = Place('pond') # One-way paths connect individual places in the world. foodService.addNewNeighbor('down', PO) PO.addNewNeighbor('south', alumniHall) alumniHall.addNewNeighbor('north', foodService) alumniHall.addNewNeighbor('east', chamberOfWizards) alumniHall.addNewNeighbor('west', library) chamberOfWizards.addNewNeighbor('west', alumniHall) chamberOfWizards.addNewNeighbor('south', dormitory) dormitory.addNewNeighbor('north', chamberOfWizards) dormitory.addNewNeighbor('west', goodShipOlin) library.addNewNeighbor('east', alumniHall) library.addNewNeighbor('south', goodShipOlin) goodShipOlin.addNewNeighbor('north', library) goodShipOlin.addNewNeighbor('east', dormitory) goodShipOlin.addNewNeighbor('up', lounge) lounge.addNewNeighbor('west', computerLab) lounge.addNewNeighbor('south', offices) computerLab.addNewNeighbor('east', lounge) offices.addNewNeighbor('north', lounge) # We define persons as follows: max = Thief('Max', offices, 2) karl = AutoPerson('Karl', computerLab, 4) barbara = Witch('Barbara', offices, 3, pond) elvee = Wizard('Elvee', chamberOfWizards, 1, chamberOfWizards) player = Person('Player', dormitory) # and now we'll strew some scrolls around: scrollOfEnlightenment = Scroll('Scroll of Enlightenment') library.gain(scrollOfEnlightenment) for title in ['Crime and Punishment', 'War and Peace', 'Iliad', 'Collected Works of Rilke']: library.gain(Scroll(title)) unixProgrammersManual = Scroll("Unix Programmer's Manual") computerLab.gain(unixProgrammersManual) nextUsersReference = Scroll("NeXT User's Reference") computerLab.gain(nextUsersReference)