public void NotifyBattleFinished(Fleet winingFleet, Fleet loosingFleet,
            int numberOfBattleRounds)
        {
            WriteNewLine();
            textBox.AppendText("After round " + numberOfBattleRounds
                               + " the " + winingFleet.FleetName + " fleet won");
            WriteNewLine();

            textBox.AppendText("  " + loosingFleet.TotalNumberOfLosses + " enemy ships destroyed");
            WriteNewLine();
            textBox.AppendText("  " + winingFleet.TotalNumberOfLosses + " ships lost");
            WriteNewLine();
            textBox.AppendText("  " + winingFleet.SizeOfActiveFleet + " ships survived");
            WriteNewLine();

            foreach (BaseShip spaceShip in winingFleet.ShipsInService)
            {
                string damage = spaceShip.DamageStatus();
                textBox.AppendText("    " + spaceShip.ShipClass + " - " + damage);
                WriteNewLine();
            }
        }
Beispiel #2
0
 public SpaceBattle(Fleet fleet1, Fleet fleet2)
 {
     this.fleet1 = fleet1;
     this.fleet2 = fleet2;
 }
Beispiel #3
0
 private Fleet CreateFleet(Random random, string fleetFile)
 {
     Fleet fleet = new Fleet(random);
     fleet.ReadFleet(fleetFile);
     return fleet;
 }
Beispiel #4
0
 private void NotifyObserversBattleFinished(Fleet winingFleet, Fleet loosingFleet)
 {
     foreach (IBattleObserver battleObserver in observers)
     {
         battleObserver.NotifyBattleFinished(winingFleet, loosingFleet, battleRounds);
     }
 }