Пример #1
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        lockable = getattr(self.target, Lockable.registered_as)
        close_lock(lockable)
        if FifeAgent.registered_as:
            fifeagent_data = getattr(self.target, FifeAgent.registered_as)
            if fifeagent_data:
                behaviour = fifeagent_data.behaviour
                behaviour.act(lockable.close_action)
                behaviour.queue_action(lockable.closed_action, repeating=True)

        EntityAction.execute(self)
Пример #2
0
 def testOpenClose(self):
     lockable.open_lock(self.lock.lockable)
     self.assertFalse(self.lock.lockable.closed)
     lockable.close_lock(self.lock.lockable)
     self.assertTrue(self.lock.lockable.closed)
Пример #3
0
 def testOpenClose(self):
     lockable.open_lock(self.lock.lockable)
     self.assertFalse(self.lock.lockable.closed)
     lockable.close_lock(self.lock.lockable)
     self.assertTrue(self.lock.lockable.closed)