示例#1
0
class Guard(Program):
    def __init__(self):
        super().__init__()
        self.name = "Guard"

        self.vision = Vision()

    def run(self):
        super().run()

        while True:
            movement = self.vision.findMovement()

            if movement is None:
                print("No movement found")
            else:
                print("Movement found at " + str(movement[0]) + ", " +
                      str(movement[1]))

            value = input("\nQuit? y/n ")
            if value == "y":
                break

        self.quit()

    def quit(self):
        super().quit()
        self.vision.quit()