public void Reconcilate(EmpireManager empireManager)
{
foreach (var star in starSystems)
{
//Set the empire
foreach (var planet in star.Planets)
{
if (planet.OwnerID != -1)
{
planet.Owner = empireManager.GetEmpire(planet.OwnerID);
planet.OwnerID = -1; //Clear out the ID
planet.Owner.PlanetManager.AddOwnedPlanet(planet);
planet.ShipBeingBuilt = planet.Owner.FleetManager.GetShipWithDesignID(planet.ShipBeingBuiltID);
}
}
star.UpdateOwners();
if (string.IsNullOrEmpty(star.ExploredByIDs))
{
//No empires explored this star yet.
continue;
}
string[] exploredBy = star.ExploredByIDs.Split(new[] { ',' });
foreach (var explored in exploredBy)
{
star.AddEmpireExplored(empireManager.GetEmpire(int.Parse(explored)));
}
}
}