Пример #1
0
 def createStateEntity(self, entity):
     return FunctionalState(CTRL_ENTITY_TYPE.LEGACY,
                            entity.getEntityType(),
                            True,
                            entity.hasLockedState(),
                            isinstance(entity, LegacyIntroEntity),
                            funcFlags=entity.getFunctionalFlags())
Пример #2
0
 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())
Пример #3
0
 def createStateEntity(self, functional):
     return FunctionalState(CTRL_ENTITY_TYPE.PREBATTLE,
                            functional.getEntityType(),
                            True,
                            functional.hasLockedState(),
                            isinstance(functional,
                                       default.IntroPrbFunctional),
                            funcFlags=functional.getFunctionalFlags())
Пример #4
0
 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()
Пример #5
0
    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
Пример #6
0
 def createStateEntity(self, entity):
     return FunctionalState(CTRL_ENTITY_TYPE.UNIT, entity.getEntityType(),
                            True, entity.hasLockedState(),
                            isinstance(entity, UnitIntroEntity),
                            entity.getFlags(), entity.getFunctionalFlags(),
                            entity.getRosterType())
Пример #7
0
 def createStateEntity(self, functional):
     return FunctionalState(CTRL_ENTITY_TYPE.PREQUEUE,
                            functional.getEntityType(),
                            True,
                            functional.isInQueue(),
                            funcFlags=functional.getFunctionalFlags())
Пример #8
0
 def createStateEntity(self, functional):
     return FunctionalState(CTRL_ENTITY_TYPE.UNIT, functional.getPrbType(),
                            True, functional.hasLockedState(),
                            isinstance(functional, IntroFunctional),
                            functional.getFlags(), functional.getExtra())
Пример #9
0
 def getFunctionalState(self):
     factory = self.__factories.get(self.__entity.getCtrlType())
     return factory.createStateEntity(
         self.__entity) if factory is not None else FunctionalState()
Пример #10
0
 def createStateEntity(self, functional):
     return FunctionalState(CTRL_ENTITY_TYPE.PREBATTLE,
                            functional.getPrbType(), True,
                            functional.hasLockedState(),
                            isinstance(functional, IntroPrbFunctional))