//Rectangle ActorBounds(Actor a) //{ // var pos = worldRenderer.ScreenPxPosition(a.CenterPosition); // var bounds = a.Bounds; // bounds.Offset(pos.X, pos.Y); // return bounds; //} public void AddOrUpdate(Player viewer, FrozenActor fa) { if (removeFrozenActors[viewer].Contains(fa)) { removeFrozenActors[viewer].Remove(fa); } addOrUpdateFrozenActors[viewer].Add(fa); }
public static void SetTargetLine(this Actor self, FrozenActor target, Color color, bool display) { if (self.Owner != self.World.LocalPlayer) { return; } self.World.AddFrameEndTask(w => { if (self.Disposed) { return; } target.Flash(); var line = self.TraitOrDefault <DrawLineToTarget>(); if (line != null) { line.SetTarget(self, Target.FromPos(target.CenterPosition), color, display); } }); }
public void Remove(Player viewer, FrozenActor fa) { removeFrozenActors[viewer].Add(fa); }
public void Remove(FrozenActor fa) { partitionedFrozenActorIds.Remove(fa.ID); world.ScreenMap.Remove(owner, fa); frozenActorsById.Remove(fa.ID); }
public void Add(FrozenActor fa) { frozenActorsById.Add(fa.ID, fa); world.ScreenMap.AddOrUpdate(owner, fa); partitionedFrozenActorIds.Add(fa.ID, FootprintBounds(fa)); }