public void OnMapEntityAdded(object sender, GoRogue.ItemEventArgs <Entity> args) { int insertionIndex = 0; for (int i = 0; i < GameLoop.UIManager.MapConsole.Children.Count; i++) { if (GameLoop.UIManager.MapConsole.Children[i] is Entity e && e.renderOrder > args.Item.renderOrder) { insertionIndex = i; break; } } GameLoop.UIManager.MapConsole.Children.Insert(insertionIndex, args.Item); }
public void OnMapEntityRemoved(object sender, GoRogue.ItemEventArgs <Entity> args) => GameLoop.UIManager.MapConsole.Children.Remove(args.Item);
public void OnMapEntityAdded(object sender, GoRogue.ItemEventArgs <Entity> args) { MapConsole.Children.Add(args.Item); }