コード例 #1
0
ファイル: Battle.cs プロジェクト: se5a/EventHorizonGui
 public bool DidShipSurviveRound(Ship ship, int round)
 {
     foreach (BattleEvent salvo in Salvos.Take(round))
     {
         if (salvo.Target == ship && salvo.TargetDestroyed)
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #2
0
ファイル: Battle.cs プロジェクト: se5a/EventHorizonGui
        public int GetEnemyStrengthAfterRound(int round)
        {
            // NOTE - may not be entirely accurate as ships shrink when they take damage!
            var salvos = Salvos.Take(round).ToArray();
            int str    = 0;

            foreach (var ship in EnemyShips)
            {
                if (DidShipSurviveRound(ship, round))
                {
                    str += ship.Size;
                }
            }
            return(str);
        }