Пример #1
0
        //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);
        }
Пример #2
0
        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);
                }
            });
        }
Пример #3
0
 public void Remove(Player viewer, FrozenActor fa)
 {
     removeFrozenActors[viewer].Add(fa);
 }
Пример #4
0
 public void Remove(FrozenActor fa)
 {
     partitionedFrozenActorIds.Remove(fa.ID);
     world.ScreenMap.Remove(owner, fa);
     frozenActorsById.Remove(fa.ID);
 }
Пример #5
0
 public void Add(FrozenActor fa)
 {
     frozenActorsById.Add(fa.ID, fa);
     world.ScreenMap.AddOrUpdate(owner, fa);
     partitionedFrozenActorIds.Add(fa.ID, FootprintBounds(fa));
 }