Beispiel #1
0
    def create_timer(self, interval, callback, data, flags):
        def timer_callback():
            # XXX: call this enter_frame instead?
            self.sys.runtime.amx._dummy_frame()
            self.sys.runtime.call_function(callback, data)

        # TODO: repeating timers
        self._timers.append((engine_time() + interval, timer_callback))
Beispiel #2
0
    def create_timer(self, interval, callback, data, flags):
        def timer_callback():
            # XXX: call this enter_frame instead?
            self.sys.runtime.amx._dummy_frame()
            self.sys.runtime.call_function(callback, data)

        # TODO: repeating timers
        self._timers.append((engine_time() + interval, timer_callback))
Beispiel #3
0
    def create_timer(self, interval, callback, data, flags):
        handle_id = self.sys.handles.new_handle(None)  # TODO: uhh, actual timer objects

        def timer_callback():
            # XXX: call this enter_frame instead?
            # self.sys.runtime.amx._dummy_frame()
            return self.sys.runtime.call_function(callback, handle_id, data)

        # TODO: repeating timers
        self._timers.append((engine_time() + interval, timer_callback))
        return handle_id
Beispiel #4
0
    def create_timer(self, interval, callback, data, flags):
        handle_id = self.sys.handles.new_handle(
            None)  # TODO: uhh, actual timer objects

        def timer_callback():
            # XXX: call this enter_frame instead?
            # self.sys.runtime.amx._dummy_frame()
            return self.sys.runtime.call_function(callback, handle_id, data)

        # TODO: repeating timers
        self._timers.append((engine_time() + interval, timer_callback))
        return handle_id
Beispiel #5
0
 def tick(self):
     self.last_tick = engine_time()
Beispiel #6
0
 def tick(self):
     self.last_tick = engine_time()