public void Refresh()
{
// Clear the satellites
RemoveVessels(mRootEntry);
if (Antenna == null) return;
// Add the satellites
foreach (ISatellite s in RTCore.Instance.Network)
{
if (s.Guid == Antenna.Guid) continue;
if (s.parentVessel != null && !MapViewFiltering.CheckAgainstFilter(s.parentVessel)) {
continue;
}
Entry current = new Entry()
{
Text = s.Name,
Guid = s.Guid,
Color = Color.white,
};
mEntries[s.Body].SubEntries.Add(current);
if (s.Guid == Antenna.Target)
{
mSelection = current;
}
}
// Set a local depth variable so we can refer to it when rendering.
Stack<Entry> dfs = new Stack<Entry>();
foreach (Entry child in mRootEntry.SubEntries)
{
child.Depth = 0;
dfs.Push(child);
}
while (dfs.Count > 0)
{
Entry current = dfs.Pop();
foreach (Entry child in current.SubEntries)
{
child.Depth = current.Depth + 1;
dfs.Push(child);
}
}
}