Sanguosha.Core.Cards.Equipment.UnregisterTriggers C# (CSharp) Method

UnregisterTriggers() public method

public UnregisterTriggers ( Player p ) : void
p Sanguosha.Core.Players.Player
return void
        public virtual void UnregisterTriggers(Player p)
        {
            if (EquipmentSkill != null)
            {
                Trace.TraceInformation("unregistered {0} from {1}", EquipmentSkill.GetType().Name, p.Id);
                p.LoseEquipmentSkill(EquipmentSkill);
            }
            UnregisterEquipmentTriggers(p);
        }

Usage Example

 /// <summary>
 /// 临时将卡牌提出,verify时使用
 /// </summary>
 /// <param name="cards">卡牌</param>
 /// <remarks>第二次调用将会摧毁第一次调用时临时区域的所有卡牌</remarks>
 public virtual void HoldInTemp(List <Card> cards)
 {
     deckBackup = new Dictionary <DeckPlace, List <Card> >();
     foreach (Card c in cards)
     {
         if (c.Place.DeckType == DeckType.None)
         {
             continue;
         }
         Trace.Assert(c.Type != null);
         if ((c.Type is Equipment) && c.Place.DeckType == DeckType.Equipment)
         {
             Equipment e = (Equipment)c.Type;
             e.UnregisterTriggers(c.Place.Player);
         }
         if (!deckBackup.ContainsKey(c.Place))
         {
             deckBackup.Add(c.Place, new List <Card>(Game.CurrentGame.Decks[c.Place]));
         }
         Game.CurrentGame.Decks[c.Place].Remove(c);
     }
     cardsOnHold = cards;
 }