Remove() public method

public Remove ( RadarPing ping ) : void
ping RadarPing
return void
Ejemplo n.º 1
0
        public void ResolveOrder(Actor self, Order order)
        {
            if (order.OrderString != "PlaceBeacon")
            {
                return;
            }

            var pos = self.World.Map.CenterOfCell(order.TargetLocation);

            self.World.AddFrameEndTask(w =>
            {
                if (playerBeacon != null)
                {
                    self.World.Remove(playerBeacon);
                }

                playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix);
                self.World.Add(playerBeacon);

                if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
                {
                    Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
                                           self.World.RenderPlayer != null ? self.World.RenderPlayer.Country.Race : null);
                }

                if (radarPings != null)
                {
                    if (playerRadarPing != null)
                    {
                        radarPings.Remove(playerRadarPing);
                    }

                    playerRadarPing = radarPings.Add(
                        () => self.Owner.IsAlliedWith(self.World.RenderPlayer),
                        pos,
                        self.Owner.Color.RGB,
                        info.Duration);
                }
            });
        }
Ejemplo n.º 2
0
        public void ResolveOrder(Actor self, Order order)
        {
            if (order.OrderString != "PlaceBeacon")
            {
                return;
            }

            self.World.AddFrameEndTask(w =>
            {
                if (playerBeacon != null)
                {
                    self.World.Remove(playerBeacon);
                }

                playerBeacon = new Beacon(self.Owner, order.Target.CenterPosition, info.Duration, info.Palette, info.IsPlayerPalette,
                                          info.BeaconImage, info.BeaconSequence, info.ArrowSequence, info.CircleSequence);

                self.World.Add(playerBeacon);

                if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
                {
                    Game.Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
                                                self.World.RenderPlayer != null ? self.World.RenderPlayer.Faction.InternalName : null);
                }

                if (radarPings != null)
                {
                    if (playerRadarPing != null)
                    {
                        radarPings.Remove(playerRadarPing);
                    }

                    playerRadarPing = radarPings.Add(
                        () => self.Owner.IsAlliedWith(self.World.RenderPlayer),
                        order.Target.CenterPosition,
                        self.Owner.Color,
                        info.Duration);
                }
            });
        }