GetFleets() публичный Метод

public GetFleets ( ) : List
Результат List
Пример #1
0
        public List <Fleet> CheckColonizableSystems(Galaxy galaxy)
        {
            List <Fleet> colonizingFleets = new List <Fleet>();

            foreach (Fleet fleet in FleetManager.GetFleets())
            {
                if (fleet.TravelNodes == null || fleet.TravelNodes.Count == 0)
                {
                    if (fleet.AdjacentSystem.Planets[0].Owner != null)
                    {
                        continue;
                    }
                    int colonyReq = fleet.AdjacentSystem.Planets[0].ColonyRequirement;
                    foreach (Ship ship in fleet.OrderedShips)
                    {
                        foreach (var special in ship.Specials)
                        {
                            if (special != null && special.Technology.Colony >= colonyReq)
                            {
                                colonizingFleets.Add(fleet);
                                break;
                            }
                        }
                    }
                }
            }
            return(colonizingFleets);
        }
Пример #2
0
        public List <StarSystem> CheckExploredSystems(Galaxy galaxy)
        {
            List <StarSystem> exploredSystems = new List <StarSystem>();

            foreach (Fleet fleet in FleetManager.GetFleets())
            {
                if (fleet.TravelNodes == null || fleet.TravelNodes.Count == 0)
                {
                    StarSystem systemExplored = fleet.AdjacentSystem;
                    if (systemExplored != null && !systemExplored.IsThisSystemExploredByEmpire(this))
                    {
                        SitRepManager.AddItem(new SitRepItem(Screen.Galaxy, systemExplored, null, new Point(systemExplored.X, systemExplored.Y), systemExplored.Name + " has been explored."));
                        systemExplored.AddEmpireExplored(this);
                        exploredSystems.Add(systemExplored);
                    }
                }
            }
            return(exploredSystems);
        }
Пример #3
0
        public void LandTransports()
        {
            List <Fleet> fleetsToRemove = new List <Fleet>();

            foreach (var fleet in FleetManager.GetFleets())
            {
                if (fleet.TransportShips.Count > 0 && (fleet.TravelNodes == null || fleet.TravelNodes.Count == 0) && fleet.AdjacentSystem != null)
                {
                    if (fleet.AdjacentSystem.Planets[0].Owner == this)
                    {
                        foreach (var transport in fleet.TransportShips)
                        {
                            fleet.AdjacentSystem.Planets[0].AddRacePopulation(transport.raceOnShip, transport.amount);
                        }
                        fleetsToRemove.Add(fleet);
                    }
                }
            }
            foreach (var fleet in fleetsToRemove)
            {
                FleetManager.RemoveFleet(fleet);
            }
        }