Skip to content

Instantly share code, notes, and snippets.

@jasondown
Created August 3, 2021 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasondown/817dcb981a80b3a04325555785ea592c to your computer and use it in GitHub Desktop.
Save jasondown/817dcb981a80b3a04325555785ea592c to your computer and use it in GitHub Desktop.
public class ObjectDependencyManager
{
private readonly NavObjectNodeFactory _navObjectNodeFactory;
private readonly List<NavObjectNode> _navObjectsToCompile;
public ObjectDependencyManager(NavObjectNodeFactory navObjectNodeFactory)
{
_navObjectNodeFactory = navObjectNodeFactory;
_navObjectsToCompile = new List<NavObjectNode>();
}
public NavObjectNode GetNavObject(int type, int id)
{
return _navObjectNodeFactory.GetNavObjectNode(type, id);
}
public void AddNavObjectToCompile(NavObjectNode navObject)
{
_navObjectsToCompile.Add(navObject);
}
public IEnumerable<NavObjectNode> SortedCompileList
{
get
{
var sorted = _navObjectsToCompile.Sort(n => n.ComposedOf);
return sorted.Where(_navObjectsToCompile.Contains);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment