def createStateEntity(self, entity): return FunctionalState(CTRL_ENTITY_TYPE.LEGACY, entity.getEntityType(), True, entity.hasLockedState(), isinstance(entity, LegacyIntroEntity), funcFlags=entity.getFunctionalFlags())
def createStateEntity(self, functional): return FunctionalState(CTRL_ENTITY_TYPE.UNIT, functional.getEntityType(), True, functional.hasLockedState(), isinstance(functional, unit.IntroFunctional), functional.getFlags(), functional.getFunctionalFlags(), functional.getRosterType())
def createStateEntity(self, functional): return FunctionalState(CTRL_ENTITY_TYPE.PREBATTLE, functional.getEntityType(), True, functional.hasLockedState(), isinstance(functional, default.IntroPrbFunctional), funcFlags=functional.getFunctionalFlags())
def getFunctionalState(self): """ Gets current functional state. Returns: current functional state """ factory = self.__factories.get(self.__entity.getCtrlType()) if factory is not None: return factory.createStateEntity(self.__entity) else: return FunctionalState()
def getState(self, factories): result = None for ctrlType, item in self.__items.iteritems(): if item and item.hasEntity(): factory = factories.get(ctrlType) if factory: result = factory.createStateEntity(item) break if result is None: result = FunctionalState() return result
def createStateEntity(self, entity): return FunctionalState(CTRL_ENTITY_TYPE.UNIT, entity.getEntityType(), True, entity.hasLockedState(), isinstance(entity, UnitIntroEntity), entity.getFlags(), entity.getFunctionalFlags(), entity.getRosterType())
def createStateEntity(self, functional): return FunctionalState(CTRL_ENTITY_TYPE.PREQUEUE, functional.getEntityType(), True, functional.isInQueue(), funcFlags=functional.getFunctionalFlags())
def createStateEntity(self, functional): return FunctionalState(CTRL_ENTITY_TYPE.UNIT, functional.getPrbType(), True, functional.hasLockedState(), isinstance(functional, IntroFunctional), functional.getFlags(), functional.getExtra())
def getFunctionalState(self): factory = self.__factories.get(self.__entity.getCtrlType()) return factory.createStateEntity( self.__entity) if factory is not None else FunctionalState()
def createStateEntity(self, functional): return FunctionalState(CTRL_ENTITY_TYPE.PREBATTLE, functional.getPrbType(), True, functional.hasLockedState(), isinstance(functional, IntroPrbFunctional))