registrator.py (1722B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\behaviors\registry\registrator.py 2 from behaviors.registry import COMPOSITE, ACTION, CONDITION, DECORATOR, MONITOR 3 from behaviors.registry.taskregistry import TaskRegistry 4 REGISTRY = TaskRegistry() 5 NO_ATTRIBUTES = {} 6 7 def register_task(task_type, task_class, attributes = None, short_description = None, detailed_description = None): 8 if attributes is None: 9 attributes = NO_ATTRIBUTES 10 REGISTRY.register_task(task_type, {'task_type': task_type, 11 'task_class': task_class, 12 'short_description': short_description, 13 'detailed_description': detailed_description, 14 'attributes': attributes}) 15 16 17 def register_composite(task_class, attributes = None, short_description = None, detailed_description = None): 18 register_task(COMPOSITE, task_class, attributes, short_description, detailed_description) 19 20 21 def register_action(task_class, attributes = None, short_description = None, detailed_description = None): 22 register_task(ACTION, task_class, attributes, short_description, detailed_description) 23 24 25 def register_condition(task_class, attributes = None, short_description = None, detailed_description = None): 26 register_task(CONDITION, task_class, attributes, short_description, detailed_description) 27 28 29 def register_decorator(task_class, attributes = None, short_description = None, detailed_description = None): 30 register_task(DECORATOR, task_class, attributes, short_description, detailed_description) 31 32 33 def register_monitor(task_class, attributes = None, short_description = None, detailed_description = None): 34 register_task(MONITOR, task_class, attributes, short_description, detailed_description)