def get_type(t): if Light.SUB_CLASSES == None: Light.SUB_CLASSES = {} classes = get_subclasses(Light) for c in classes: Light.SUB_CLASSES[c.TYPE] = c if not t in Light.SUB_CLASSES: raise Exception("Unknown light type: " + hex(t)) return Light.SUB_CLASSES[t]
def get_event_class(self, type): if self.EVENT_CLASSES == None: self.EVENT_CLASSES = {} classes = get_subclasses(Event) for c in classes: if c.TYPE: self.EVENT_CLASSES[c.TYPE] = c if not type in self.EVENT_CLASSES: raise Exception("Clip Event Type %x is not supported!" % type) return self.EVENT_CLASSES[type]
def get_step(id): if TextureStep.STEPS == None: TextureStep.STEPS = {} cs = get_subclasses(TextureStep) for c in cs: if c.ID > 0: TextureStep.STEPS[c.ID] = c return TextureStep.STEPS[id]
def get_node_types(): if DecisionGraphNode.NODE_TYPES == None: DecisionGraphNode.NODE_TYPES = tuple( filter(lambda c: c.ID > 0, get_subclasses(DecisionGraphNode))) return DecisionGraphNode.NODE_TYPES
def get_type(typecode): if TextureStep.Param.PARAM_TYPES == None: TextureStep.Param.PARAM_TYPES = {} for c in get_subclasses(TextureStep.Param): TextureStep.Param.PARAM_TYPES[c.TYPE] = c return TextureStep.Param.PARAM_TYPES[typecode]
def get_node_types(): if DecisionGraphNode.NODE_TYPES == None: DecisionGraphNode.NODE_TYPES = tuple(filter(lambda c: c.ID > 0, get_subclasses(DecisionGraphNode))) return DecisionGraphNode.NODE_TYPES