示例#1
0
 /// <summary>
 /// Updates the list of ships destroyed and still in service. 
 /// Returns the list of ships class names which have been destroyed.  
 /// </summary>
 /// <returns></returns>
 private string[] UpdateDestroyedShips()
 {
     string[] destroyedShipNames = {};
     for (int index = 0; index < SpaceShipsInService.Length; index++)
     {
         SpaceShip spaceShip = SpaceShipsInService[index];
         if (spaceShip.IsDestroyed())
         {
             RemoveDestroyedShipFromService(spaceShip, index);
             destroyedShipNames = ArrayUtils.AddStringToArray(destroyedShipNames,
                 spaceShip.ShipClassName);
         }
     }
     return destroyedShipNames;
 }