public void SetTentativePath(StarSystem destination, bool hasExtendedFuelTanks, Galaxy galaxy)
{
if (destination == null || destination == _adjacentSystem)
{
//if destination is same as origin, or nowhere, clear the tentative path
TentativeNodes = null;
return;
}
if (_travelNodes != null && _travelNodes[_travelNodes.Count - 1].StarSystem == destination)
{
//Same path as current path
TentativeNodes = null;
return;
}
if (TentativeNodes != null && TentativeNodes[_tentativeNodes.Count - 1].StarSystem == destination)
{
// Existing tentative path
return;
}
StarSystem currentDestination = null;
if (_adjacentSystem == null) //Has left a system
{
currentDestination = _travelNodes[0].StarSystem;
}
List<TravelNode> path = galaxy.GetPath(_galaxyX, _galaxyY, currentDestination, destination, hasExtendedFuelTanks, _empire);
if (path == null)
{
TentativeNodes = null;
return;
}
TentativeNodes = path;
if (TentativeNodes.Count == 0)
{
TentativeNodes = null;
}
}