2022-04-26 21:34:43 +08:00
|
|
|
#api
|
2022-01-20 18:16:08 +08:00
|
|
|
from PikaObj import *
|
|
|
|
import PikaStdData
|
2022-06-21 03:29:29 +00:00
|
|
|
import PikaStdLib
|
2022-01-20 18:16:08 +08:00
|
|
|
|
2022-01-23 21:31:07 +08:00
|
|
|
|
2022-06-21 03:29:29 +00:00
|
|
|
class Task(PikaStdLib.SysObj):
|
2022-01-31 01:49:34 +08:00
|
|
|
calls = PikaStdData.List()
|
2022-01-23 21:31:07 +08:00
|
|
|
|
2022-04-07 23:01:59 +08:00
|
|
|
def __init__(self):
|
2022-01-20 18:16:08 +08:00
|
|
|
pass
|
|
|
|
|
2022-01-31 01:49:34 +08:00
|
|
|
# regist a function to be called always
|
2022-04-07 23:01:59 +08:00
|
|
|
def call_always(self, fun_todo: any):
|
2022-01-20 18:16:08 +08:00
|
|
|
pass
|
2022-01-31 01:49:34 +08:00
|
|
|
|
|
|
|
# regist a function to be called when fun_when() return 'True'
|
2022-04-07 23:01:59 +08:00
|
|
|
def call_when(self, fun_todo: any, fun_when: any):
|
2022-01-20 18:16:08 +08:00
|
|
|
pass
|
|
|
|
|
2022-01-31 01:49:34 +08:00
|
|
|
# regist a function to be called periodically
|
2022-04-07 23:01:59 +08:00
|
|
|
def call_period_ms(self, fun_todo: any, period_ms: int):
|
2022-01-23 21:31:07 +08:00
|
|
|
pass
|
|
|
|
|
2022-01-31 01:49:34 +08:00
|
|
|
# run all registed function once
|
2022-04-07 23:01:59 +08:00
|
|
|
def run_once(self):
|
2022-01-20 18:16:08 +08:00
|
|
|
pass
|
|
|
|
|
2022-01-31 01:49:34 +08:00
|
|
|
# run all registed function forever
|
2022-04-07 23:01:59 +08:00
|
|
|
def run_forever(self):
|
2022-01-20 18:16:08 +08:00
|
|
|
pass
|
2022-01-23 21:31:07 +08:00
|
|
|
|
2022-01-31 01:49:34 +08:00
|
|
|
# run all registed function until time is up
|
2022-04-07 23:01:59 +08:00
|
|
|
def run_until_ms(self, until_ms: int):
|
2022-01-31 01:49:34 +08:00
|
|
|
pass
|
|
|
|
|
|
|
|
# need be overried to supply the system tick
|
2022-04-07 23:01:59 +08:00
|
|
|
def platformGetTick(self):
|
2022-01-23 21:31:07 +08:00
|
|
|
pass
|