AddFleet() public method

public AddFleet ( Fleet fleet ) : void
fleet Fleet
return void
Exemplo n.º 1
0
 public void CheckForBuiltShips()
 {
     foreach (Planet planet in PlanetManager.Planets)
     {
         int  amount;
         Ship result = planet.CheckIfShipBuilt(out amount);
         if (amount > 0 && result != null)
         {
             Fleet newFleet = new Fleet();
             newFleet.Empire         = this;
             newFleet.GalaxyX        = planet.System.X;
             newFleet.GalaxyY        = planet.System.Y;
             newFleet.AdjacentSystem = planet.System;
             newFleet.AddShips(result, amount);
             FleetManager.AddFleet(newFleet);
             SitRepManager.AddItem(new SitRepItem(Screen.Galaxy, planet.System, planet, new Point(planet.System.X, planet.System.Y), planet.Name + " has produced " + amount + " " + result.Name + " ship" + (amount > 1 ? "s." : ".")));
         }
     }
     FleetManager.MergeIdleFleets();
 }
Exemplo n.º 2
0
 public void LaunchTransports()
 {
     foreach (var planet in PlanetManager.Planets)
     {
         if (planet.TransferSystem.Key.StarSystem != null)
         {
             Fleet newFleet = new Fleet();
             newFleet.Empire  = this;
             newFleet.GalaxyX = planet.System.X;
             newFleet.GalaxyY = planet.System.Y;
             newFleet.AddTransport(planet.Races[0], planet.TransferSystem.Value);
             newFleet.TravelNodes = new List <TravelNode> {
                 planet.TransferSystem.Key
             };
             planet.RemoveRacePopulation(planet.Races[0], planet.TransferSystem.Value);
             planet.TransferSystem = new KeyValuePair <TravelNode, int>(new TravelNode(), 0);
             newFleet.ResetMove();
             FleetManager.AddFleet(newFleet);
         }
     }
 }