Ejemplo n.º 1
0
 def __createByAccountState(self, ctx):
     clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         if prb_getters.isPrebattleSettingsReceived(prebattle=clientPrb):
             prbSettings = prb_getters.getPrebattleSettings(
                 prebattle=clientPrb)
             prbType = prb_getters.getPrebattleType(settings=prbSettings)
             clazz = None
             clazz = collectLegacyEntity(prbType)
             if clazz:
                 return clazz(prbSettings)
         else:
             return LegacyInitEntity()
     return self.__createByPrbType(ctx)
Ejemplo n.º 2
0
 def __createByAccountState(self, ctx):
     """
     Tries to create entity by current account state.
     Args:
         ctx: creation request context.
     
     Returns:
         new prebattle legacy entity
     """
     clientPrb = prb_getters.getClientPrebattle()
     if clientPrb is not None:
         if prb_getters.isPrebattleSettingsReceived(prebattle=clientPrb):
             prbSettings = prb_getters.getPrebattleSettings(prebattle=clientPrb)
             prbType = prb_getters.getPrebattleType(settings=prbSettings)
             clazz = None
             if prbType in _SUPPORTED_ENTITY:
                 clazz = _SUPPORTED_ENTITY[prbType]
             if clazz:
                 return clazz(prbSettings)
         else:
             return LegacyInitEntity()
     return self.__createByPrbType(ctx)