def start(self, startCtx=None):
     """
     Battle session is started.
     :param startCtx: instance of BattleSessionProviderStartCtx.
     :return:
     """
     isReplayRecording = startCtx.replayCtrl.isRecording
     isReplayPlaying = startCtx.replayCtrl.isPlaying
     self.__arenaDP = ArenaDataProvider(avatar=startCtx.avatar)
     self.__ctx.start(self.__arenaDP)
     self.__ammoCtrl = consumables.createAmmoCtrl(isReplayPlaying,
                                                  isReplayRecording)
     self.__equipmentsCtrl = consumables.createEquipmentCtrl(
         isReplayPlaying)
     self.__optDevicesCtrl = consumables.createOptDevicesCtrl()
     self.__vehicleStateCtrl = vehicle_state_ctrl.createCtrl(
         isReplayRecording)
     self.__arenaLoadCtrl = ArenaLoadController()
     self.__arenaTeamsBasesCtrl = createTeamsBasesCtrl(isReplayPlaying)
     self.__periodCtrl = createPeriodCtrl(isReplayPlaying,
                                          isReplayRecording)
     self.__respawnsCtrl = RespawnsController(startCtx)
     self.__repairCtrl = RepairController()
     self.__dynSquadFunctional = DynSquadFunctional(isReplayPlaying)
     self.__notificationsCtrl = NotificationsController(self.__arenaDP)
     self.__gasAttackCtrl = GasAttackController(startCtx)
     ctx = weakref.proxy(self.__ctx)
     self.__arenaListeners = ListenersCollection()
     self.__arenaListeners.addController(ctx, self.__arenaLoadCtrl)
     self.__arenaListeners.addController(ctx, self.__arenaTeamsBasesCtrl)
     self.__arenaListeners.addController(ctx, self.__periodCtrl)
     self.__arenaListeners.addController(ctx, self.__respawnsCtrl)
     self.__arenaListeners.addController(ctx, self.__dynSquadFunctional)
     self.__arenaListeners.start(startCtx.avatar.arena,
                                 arenaDP=self.__arenaDP)
     self.__feedback = createFeedbackAdaptor(isReplayPlaying)
     self.__feedback.start(self.__arenaDP)
     self.__messagesCtrl = createBattleMessagesCtrl(isReplayPlaying)
     self.__messagesCtrl.start(ctx)
     self.__drrScaleCtrl = DRRScaleController()
     self.__drrScaleCtrl.start(self.__messagesCtrl)
     self.__hitDirectionCtrl = HitDirectionController()
     self.__hitDirectionCtrl.start()
     g_playerEvents.onBattleResultsReceived += self.__pe_onBattleResultsReceived
     self.__chatCommands = ChatCommandsController()
     self.__chatCommands.start(self.__arenaDP, self.__feedback)
     self.__requestsCtrl = AvatarRequestsController()
     self.__avatarStatsCtrl = AvatarStatsController()
     self.__debugCtrl = DebugController()
     self.__debugCtrl.start()
     self.__viewComponentsBridge = createComponentsBridge()
     self.__viewComponentsBridge.registerControllers(
         (BATTLE_CTRL.PERIOD, self.__periodCtrl),
         (BATTLE_CTRL.TEAM_BASES, self.__arenaTeamsBasesCtrl),
         (BATTLE_CTRL.DEBUG, self.__debugCtrl),
         (BATTLE_CTRL.HIT_DIRECTION, self.__hitDirectionCtrl))
 def start(self, startCtx = None):
     """
     Battle session is started.
     :param startCtx: instance of BattleSessionProviderStartCtx.
     :return:
     """
     isReplayRecording = startCtx.replayCtrl.isRecording
     isReplayPlaying = startCtx.replayCtrl.isPlaying
     self.__arenaDP = ArenaDataProvider(avatar=startCtx.avatar)
     self.__ctx.start(self.__arenaDP)
     self.__ammoCtrl = consumables.createAmmoCtrl(isReplayPlaying, isReplayRecording)
     self.__equipmentsCtrl = consumables.createEquipmentCtrl(isReplayPlaying)
     self.__optDevicesCtrl = consumables.createOptDevicesCtrl()
     self.__vehicleStateCtrl = vehicle_state_ctrl.createCtrl(isReplayRecording)
     self.__arenaLoadCtrl = ArenaLoadController()
     self.__arenaTeamsBasesCtrl = createTeamsBasesCtrl(isReplayPlaying)
     self.__periodCtrl = createPeriodCtrl(isReplayPlaying, isReplayRecording)
     self.__respawnsCtrl = RespawnsController(startCtx)
     self.__repairCtrl = RepairController()
     self.__dynSquadFunctional = DynSquadFunctional(isReplayPlaying)
     self.__notificationsCtrl = NotificationsController(self.__arenaDP)
     self.__gasAttackCtrl = GasAttackController(startCtx)
     ctx = weakref.proxy(self.__ctx)
     self.__arenaListeners = ListenersCollection()
     self.__arenaListeners.addController(ctx, self.__arenaLoadCtrl)
     self.__arenaListeners.addController(ctx, self.__arenaTeamsBasesCtrl)
     self.__arenaListeners.addController(ctx, self.__periodCtrl)
     self.__arenaListeners.addController(ctx, self.__respawnsCtrl)
     self.__arenaListeners.addController(ctx, self.__dynSquadFunctional)
     self.__arenaListeners.start(startCtx.avatar.arena, arenaDP=self.__arenaDP)
     self.__feedback = createFeedbackAdaptor(isReplayPlaying)
     self.__feedback.start(self.__arenaDP)
     self.__messagesCtrl = createBattleMessagesCtrl(isReplayPlaying)
     self.__messagesCtrl.start(ctx)
     self.__drrScaleCtrl = DRRScaleController()
     self.__drrScaleCtrl.start(self.__messagesCtrl)
     self.__hitDirectionCtrl = HitDirectionController()
     self.__hitDirectionCtrl.start()
     g_playerEvents.onBattleResultsReceived += self.__pe_onBattleResultsReceived
     self.__chatCommands = ChatCommandsController()
     self.__chatCommands.start(self.__arenaDP, self.__feedback)
     self.__requestsCtrl = AvatarRequestsController()
     self.__avatarStatsCtrl = AvatarStatsController()
     self.__debugCtrl = DebugController()
     self.__debugCtrl.start()
     self.__viewComponentsBridge = createComponentsBridge()
     self.__viewComponentsBridge.registerControllers((BATTLE_CTRL.PERIOD, self.__periodCtrl), (BATTLE_CTRL.TEAM_BASES, self.__arenaTeamsBasesCtrl), (BATTLE_CTRL.DEBUG, self.__debugCtrl), (BATTLE_CTRL.HIT_DIRECTION, self.__hitDirectionCtrl))
Exemple #3
0
 def start(self, avatar=None):
     import BattleReplay
     replayCtrl = BattleReplay.g_replayCtrl
     isReplayRecording = replayCtrl.isRecording
     isReplayPlaying = replayCtrl.isPlaying
     self.__arenaDP = ArenaDataProvider(avatar=avatar)
     self.__ctx.start(self.__arenaDP)
     self.__ammoCtrl = consumables.createAmmoCtrl(isReplayPlaying,
                                                  isReplayRecording)
     self.__equipmentsCtrl = consumables.createEquipmentCtrl(
         isReplayPlaying)
     self.__optDevicesCtrl = consumables.createOptDevicesCtrl()
     self.__vehicleStateCtrl = vehicle_state_ctrl.createCtrl(
         isReplayRecording)
     isMultiTeam = self.__arenaDP.isMultipleTeams()
     self.__arenaLoadCtrl = ArenaLoadController(isMultiTeam)
     self.__arenaTeamsBasesCtrl = createTeamsBasesCtrl(isReplayPlaying)
     self.__periodCtrl = createPeriodCtrl(isReplayPlaying,
                                          isReplayRecording)
     self.__drrScaleCtrl = DRRScaleController()
     self.__respawnsCtrl = RespawnsController()
     self.__repairCtrl = RepairController()
     self.__dynSquadFunctional = DynSquadFunctional()
     self.__notificationsCtrl = NotificationsController(self.__arenaDP)
     ctx = weakref.proxy(self.__ctx)
     self.__arenaListeners = ListenersCollection()
     self.__arenaListeners.addController(ctx, self.__arenaLoadCtrl)
     self.__arenaListeners.addController(ctx, self.__arenaTeamsBasesCtrl)
     self.__arenaListeners.addController(ctx, self.__periodCtrl)
     self.__arenaListeners.addController(ctx, self.__respawnsCtrl)
     self.__arenaListeners.start(getClientArena(avatar=avatar),
                                 arenaDP=self.__arenaDP)
     self.__feedback = createFeedbackAdaptor(isReplayPlaying)
     self.__feedback.start(self.__arenaDP)
     self.__messagesCtrl = createBattleMessagesCtrl(isReplayPlaying)
     self.__messagesCtrl.start(ctx)
     self.__hitDirectionCtrl = HitDirectionController()
     self.__hitDirectionCtrl.start()
     g_playerEvents.onBattleResultsReceived += self.__pe_onBattleResultsReceived
     self.__chatCommands = ChatCommandsController()
     self.__chatCommands.start(self.__arenaDP, self.__feedback)
     self.__requestsCtrl = AvatarRequestsController()
     self.__avatarStatsCtrl = AvatarStatsController()
    def start(self, avatar=None):
        import BattleReplay

        replayCtrl = BattleReplay.g_replayCtrl
        isReplayRecording = replayCtrl.isRecording
        isReplayPlaying = replayCtrl.isPlaying
        self.__arenaDP = ArenaDataProvider(avatar=avatar)
        self.__ctx.start(self.__arenaDP)
        self.__ammoCtrl = consumables.createAmmoCtrl(isReplayPlaying, isReplayRecording)
        self.__equipmentsCtrl = consumables.createEquipmentCtrl(isReplayPlaying)
        self.__optDevicesCtrl = consumables.createOptDevicesCtrl()
        self.__vehicleStateCtrl = vehicle_state_ctrl.createCtrl(isReplayRecording)
        isMultiTeam = self.__arenaDP.isMultipleTeams()
        self.__arenaLoadCtrl = ArenaLoadController(isMultiTeam)
        self.__arenaTeamsBasesCtrl = createTeamsBasesCtrl(isReplayPlaying)
        self.__periodCtrl = createPeriodCtrl(isReplayPlaying, isReplayRecording)
        self.__drrScaleCtrl = DRRScaleController()
        self.__respawnsCtrl = RespawnsController()
        self.__repairCtrl = RepairController()
        self.__dynSquadFunctional = DynSquadFunctional()
        self.__notificationsCtrl = NotificationsController(self.__arenaDP)
        ctx = weakref.proxy(self.__ctx)
        self.__arenaListeners = ListenersCollection()
        self.__arenaListeners.addController(ctx, self.__arenaLoadCtrl)
        self.__arenaListeners.addController(ctx, self.__arenaTeamsBasesCtrl)
        self.__arenaListeners.addController(ctx, self.__periodCtrl)
        self.__arenaListeners.addController(ctx, self.__respawnsCtrl)
        self.__arenaListeners.start(getClientArena(avatar=avatar), arenaDP=self.__arenaDP)
        self.__feedback = createFeedbackAdaptor(isReplayPlaying)
        self.__feedback.start(self.__arenaDP)
        self.__messagesCtrl = createBattleMessagesCtrl(isReplayPlaying)
        self.__messagesCtrl.start(ctx)
        self.__hitDirectionCtrl = HitDirectionController()
        self.__hitDirectionCtrl.start()
        g_playerEvents.onBattleResultsReceived += self.__pe_onBattleResultsReceived
        self.__chatCommands = ChatCommandsController()
        self.__chatCommands.start(self.__arenaDP, self.__feedback)
        self.__requestsCtrl = AvatarRequestsController()
        self.__avatarStatsCtrl = AvatarStatsController()