benutze/klettere Leiter
findItemById() iteriert jetzt richtig übers Dictionary
This commit is contained in:
19
tomb.py
19
tomb.py
@@ -19,6 +19,8 @@ def verarbeiteBefehl(parsedCommand):
|
||||
actionmodul.nimm(parsedCommand)
|
||||
elif id == '3':
|
||||
actionmodul.untersuche(parsedCommand)
|
||||
elif id == '4':
|
||||
actionmodul.benutze(parsedCommand)
|
||||
elif id == '5':
|
||||
actionmodul.nord()
|
||||
elif id == '6':
|
||||
@@ -49,6 +51,8 @@ def verarbeiteBefehl(parsedCommand):
|
||||
actionmodul.oeffne(parsedCommand)
|
||||
elif id == '21':
|
||||
actionmodul.klettere(parsedCommand)
|
||||
elif id == '22':
|
||||
actionmodul.fange(parsedCommand)
|
||||
elif id == '-1':
|
||||
world.fehler = 'Ich verstehe diesen Befehl nicht'
|
||||
else:
|
||||
@@ -86,10 +90,7 @@ def inputLoop(stdscr):
|
||||
logging.debug(f'debugcommand: {debugcommand}')
|
||||
|
||||
if debugcommand[1] == 'items':
|
||||
logging.debug('liste Items')
|
||||
logging.debug(world.gegenstaende)
|
||||
for item in world.gegenstaende:
|
||||
logging.debug(f'Id:{item.id} - Name:{item.name}')
|
||||
world.debug_Items()
|
||||
|
||||
|
||||
else:
|
||||
@@ -99,4 +100,14 @@ def inputLoop(stdscr):
|
||||
schrittzaehler = schrittzaehler +1
|
||||
actionmodul.raumaction()
|
||||
|
||||
def debug_Items():
|
||||
logging.debug('liste Items')
|
||||
logging.debug(world.gegenstaende)
|
||||
count = 0
|
||||
for item in world.gegenstaende:
|
||||
logging.debug(f'count= {count}')
|
||||
logging.debug('Itemtyp: ' + str(type(item)))
|
||||
# logging.debug(f'Item-IdId:{item.id} - Item-Name:{item.name}')
|
||||
count = count +1
|
||||
|
||||
wrapper(inputLoop)
|
||||
|
Reference in New Issue
Block a user