예제 #1
0
 // Add ship into fleet version 1
 public void Add(Ship ship)
 {
     ships.Add(ship);
 }
예제 #2
0
 // Start firing between ship and it's target
 public void Fire(Ship target)
 {
     // If damage is less than opponent's shield
     if (damage < target.Shield)
     {
         // Drain the shield
         target.DrainShield(damage);
     }
     else
     {
         // Drain the strength
         target.DrainStrength(damage);
         // Reduce the shield to 0
         target.EmptyShield();
     }
 }