public void SetLastPosition(string gumpID, Point position) { if (LastPositions.ContainsKey(gumpID)) { LastPositions[gumpID] = position; } else { LastPositions.Add(gumpID, position); } }
public static void Load() { var spawn = ObjectManager.Get <Obj_SpawnPoint>().Where(s => s.IsEnemy).FirstOrDefault(); SpawnPoint = spawn != null ? spawn.Position : Vector3.Zero; foreach (var enemy in HeroManager.Enemies) { var eStruct = new LastPositionStruct(enemy) { LastPosition = SpawnPoint }; LastPositions.Add(eStruct); } Obj_AI_Base.OnTeleport += Obj_AI_Base_OnTeleport; Game.OnUpdate += Game_OnUpdate; }
public async void addToLastPositions(Position p) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () => { // Remember 3 last positions and throw away first added item if (LastPositions.Count >= 4) { LastPositions.RemoveAt(0); } // Add the next position LastPositions.Add(p); // Set size relative to order moved in for (int counter = 1; counter < LastPositions.Count; counter++) { LastPositions[counter].Size = 25 - (5 * counter); } Changed("LastPositions"); }); }