コード例 #1
0
ファイル: KnownQuestTarget.cs プロジェクト: IgNit3R/ing
 public void OnBattleComplete(MapRouting routing, Battle battle, BattleResult result)
 {
     foreach (var c in Counters)
     {
         if (c is BattleResultCounter bc)
         {
             bc.OnBattleComplete(StatePersist, routing, battle, result);
         }
     }
     UpdateProgress();
 }
コード例 #2
0
ファイル: KnownQuestTarget.cs プロジェクト: IgNit3R/ing
 public void OnMapRouting(MapRouting routing, HomeportFleet fleet, HomeportFleet fleet2)
 {
     foreach (var c in Counters)
     {
         if (c is MapRoutingCounter rc)
         {
             rc.OnMapRouting(StatePersist, routing, fleet, fleet2);
         }
     }
     UpdateProgress();
 }
コード例 #3
0
ファイル: KnownQuestTarget.cs プロジェクト: lyu0912/ing
 public void OnMapRouting(MapRouting routing)
 {
     foreach (var c in Counters)
     {
         if (c is MapRoutingCounter rc)
         {
             rc.OnMapRouting(StatePersist, routing);
         }
     }
     UpdateProgress();
 }
コード例 #4
0
ファイル: BattleManager.cs プロジェクト: IgNit3R/ing
        internal BattleManager(GameProvider listener, NavalBase navalBase)
        {
            this.navalBase = navalBase;

            listener.HomeportReturned += (t, m) =>
            {
                using (EnterBatchNotifyScope())
                {
                    CurrentRouting = null;
                    CurrentBattle  = null;
                    sortieFleet    = null;
                    sortieFleet2   = null;
                    exerciseFleet  = null;
                }
            };

            listener.ExerciseStarted += (t, m) =>
            {
                exerciseFleet = this.navalBase.Fleets[m];
                CurrentBattle = new Battle(exerciseFleet, null, CombinedFleetType.None, BattleKind.Normal);
            };

            listener.SortieStarting += (t, m) =>
            {
                sortieFleet = this.navalBase.Fleets[m.FleetId];
                if (m.FleetId == 1 && this.navalBase.CombinedFleet != CombinedFleetType.None)
                {
                    sortieFleet2 = this.navalBase.Fleets[(FleetId)2];
                }
                navalBase.Quests.Knowledges?.OnSortieStart(m.MapId, sortieFleet, sortieFleet2);
            };

            listener.MapRouting += (t, m) =>
            {
                CurrentRouting = new MapRouting(this.navalBase, m);
                CurrentBattle  = new Battle(sortieFleet, sortieFleet2, this.navalBase.CombinedFleet, m.BattleKind);
                navalBase.Quests.Knowledges?.OnMapRouting(CurrentRouting, sortieFleet, sortieFleet2);
            };

            listener.BattleStarted += (t, m) =>
            {
                CurrentBattle.Append(this.navalBase.MasterData, m.Parsed);
            };

            listener.BattleAppended += (t, m) =>
            {
                CurrentBattle.Append(this.navalBase.MasterData, m.Parsed);
            };

            listener.BattleCompleted += (t, m) =>
            {
                CurrentBattleResult = new BattleResult(this.navalBase.MasterData, m, CurrentBattle.Ally);
                if (exerciseFleet is null)
                {
                    navalBase.Quests.Knowledges?.OnBattleComplete(CurrentRouting, CurrentBattle, CurrentBattleResult);
                }
                else
                {
                    navalBase.Quests.Knowledges?.OnExerciseComplete(exerciseFleet, CurrentBattleResult);
                }
            };
        }