From 3b29f77d57bdbddfc0206b7da6babe1c110395f0 Mon Sep 17 00:00:00 2001 From: Olli Graf Date: Thu, 12 May 2022 19:51:04 +0200 Subject: [PATCH] Testmodul. --- TestModule.py | 21 +++++++++++++++++++++ tomb.py | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 TestModule.py diff --git a/TestModule.py b/TestModule.py new file mode 100644 index 0000000..34d9dfb --- /dev/null +++ b/TestModule.py @@ -0,0 +1,21 @@ +import logging +import ActionModul + +class TestModule: + + def __init__(self, world): + + logging.debug(f'** init Testmodule {world}') + self.world = world + self.actionmodul = ActionModul.ActionModul(world) + + def testOeffneTruhe(self): + + pcmd = self.world.parseInput('nimm Truhe') + self.actionmodul.rauf() + self.actionmodul.nimm(pcmd) + self.actionmodul.runter() + self.actionmodul.sued() + + + diff --git a/tomb.py b/tomb.py index 062df42..8c769fc 100755 --- a/tomb.py +++ b/tomb.py @@ -1,6 +1,7 @@ #!/usr/bin/python3 import World import ActionModul +import TestModule import signal import sys import logging @@ -91,6 +92,16 @@ def inputLoop(stdscr): if debugcommand[1] == 'items': debug_Items() + elif command.startswith('auto:'): + command = command.rstrip() + if command.startswith('auto:'): + debugcommand = command.split(':',1) + + logging.debug(f'debugcommand: {debugcommand}') + testmodul = TestModule.TestModule(world) + + if(debugcommand[1] == 'truhe'): + testmodul.testOeffneTruhe() else: