예제 #1
0
        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);
        }
예제 #2
0
 public void OnMapEntityRemoved(object sender, GoRogue.ItemEventArgs <Entity> args) =>
 GameLoop.UIManager.MapConsole.Children.Remove(args.Item);
예제 #3
0
 public void OnMapEntityAdded(object sender, GoRogue.ItemEventArgs <Entity> args)
 {
     MapConsole.Children.Add(args.Item);
 }