当前位置: 首页>>代码示例>>C#>>正文


C# Cards.ReadOnlyCard类代码示例

本文整理汇总了C#中Sanguosha.Core.Cards.ReadOnlyCard的典型用法代码示例。如果您正苦于以下问题:C# ReadOnlyCard类的具体用法?C# ReadOnlyCard怎么用?C# ReadOnlyCard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReadOnlyCard类属于Sanguosha.Core.Cards命名空间,在下文中一共展示了ReadOnlyCard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Process

        protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
        {
            IUiProxy ui = Game.CurrentGame.UiProxies[source];
            if (source.IsDead) return;
            List<DeckPlace> places = new List<DeckPlace>();
            places.Add(new DeckPlace(dest, DeckType.Hand));
            places.Add(new DeckPlace(dest, DeckType.Equipment));
            places.Add(new DeckPlace(dest, DeckType.DelayedTools));
            List<string> resultDeckPlace = new List<string>();
            resultDeckPlace.Add(ResultDeckName);
            List<int> resultDeckMax = new List<int>();
            resultDeckMax.Add(1);
            List<List<Card>> answer;
            if (!ui.AskForCardChoice(new CardChoicePrompt(ChoicePrompt), places, resultDeckPlace, resultDeckMax, new RequireOneCardChoiceVerifier(true), out answer))
            {
                Trace.TraceInformation("Player {0} Invalid answer", source.Id);
                answer = new List<List<Card>>();
                answer.Add(Game.CurrentGame.PickDefaultCardsFrom(places));
            }
            Card theCard = answer[0][0];

            if (ShunChaiDest(source, dest).DeckType == DeckType.Discard)
            {
                Game.CurrentGame.HandleCardDiscard(dest, new List<Card>() { theCard });
            }
            else
            {
                Game.CurrentGame.HandleCardTransferToHand(dest, source, new List<Card>() { theCard });
            }
        }
开发者ID:h1398123,项目名称:sgs,代码行数:30,代码来源:ShunChai.cs

示例2: Process

 protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard)
 {
     IUiProxy ui = Game.CurrentGame.UiProxies[dest];
     HuoGongCardChoiceVerifier v1 = new HuoGongCardChoiceVerifier();
     ISkill s;
     List<Player> p;
     List<Card> cards;
     if (dest.IsDead) return;
     if (!ui.AskForCardUsage(new CardUsagePrompt("HuoGong", source), v1, out s, out cards, out p))
     {
         Trace.TraceInformation("Player {0} Invalid answer", dest);
         cards = new List<Card>();
         if (Game.CurrentGame.Decks[dest, DeckType.Hand].Count == 0)
         {
             Trace.TraceError("HuoGong Cannot Show Card! This should NOT have happened!");
             return;
         }
         cards.Add(Game.CurrentGame.Decks[dest, DeckType.Hand][0]);
     }
     Trace.TraceInformation("Player {0} HuoGong showed {1}, ", dest.Id, cards[0].Suit);
     if (source.IsDead) return;
     ui = Game.CurrentGame.UiProxies[source];
     HuoGongCardMatchVerifier v2 = new HuoGongCardMatchVerifier(cards[0].Suit);
     v2.Owner = source;
     if (ui.AskForCardUsage(new CardUsagePrompt("HuoGong2", dest, cards[0].Suit), v2, out s, out cards, out p))
     {
         Game.CurrentGame.HandleCardDiscard(source, cards);
         Game.CurrentGame.DoDamage(source, dest, 1, DamageElement.Fire, card, readonlyCard);
     }
     else
     {
         Trace.TraceInformation("HuoGong aborted, failed to provide card");
     }
 }
开发者ID:kissgoodbye,项目名称:sgs,代码行数:34,代码来源:HuoGong.cs

示例3: Activate

 public override void Activate(Player p, Card c)
 {
     while (true)
     {
         GameEventArgs args = new GameEventArgs();
         args.Source = null;
         args.Targets = new List<Player>() { p };
         args.Card = c;
         args.ReadonlyCard = new ReadOnlyCard(c);
         try
         {
             Game.CurrentGame.Emit(GameEvent.CardUsageBeforeEffected, args);
         }
         catch (TriggerResultException e)
         {
             Trace.Assert(e.Status == TriggerResult.End);
             break;
         }
         ReadOnlyCard result = Game.CurrentGame.Judge(p, null, c, (judgeResultCard) => { return judgeResultCard.Suit == SuitType.Spade && judgeResultCard.Rank >= 2 && judgeResultCard.Rank <= 9; });
         if (result.Suit == SuitType.Spade && result.Rank >= 2 && result.Rank <= 9)
         {
             var roc = new ReadOnlyCard(c);
             CardsMovement move = new CardsMovement();
             move.Cards = new List<Card>();
             move.Cards.Add(c);
             move.To = new DeckPlace(null, DeckType.Discard);
             Game.CurrentGame.MoveCards(move);
             Game.CurrentGame.DoDamage(null, p, 3, DamageElement.Lightning, c, roc);
             return;
         }
         break;
     }
     RecursiveShanDianDriver(p, p, c);
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:34,代码来源:ShanDian.cs

示例4: Process

 public override void Process(Player source, List<Player> dests, ICard card, ReadOnlyCard readonlyCard)
 {
     DeckType wuguDeck = new DeckType("WuGu");
     DeckType wuguFakeDeck = new DeckType("WuGuFake");
     CardsMovement move = new CardsMovement();
     move.Cards = new List<Card>();
     for (int i = 0; i < dests.Count; i++)
     {
         Game.CurrentGame.SyncImmutableCardAll(Game.CurrentGame.PeekCard(0));
         Card c = Game.CurrentGame.DrawCard();
         move.Cards.Add(c);
     }
     move.To = new DeckPlace(null, wuguDeck);
     Game.CurrentGame.MoveCards(move);
     fakeMapping = new Dictionary<Card, Card>();
     Game.CurrentGame.Decks[null, wuguFakeDeck].Clear();
     foreach (var c in Game.CurrentGame.Decks[null, wuguDeck])
     {
         var faked = new Card(c);
         faked.Place = new DeckPlace(null, wuguFakeDeck);
         Game.CurrentGame.Decks[null, wuguFakeDeck].Add(faked);
         fakeMapping.Add(faked, c);
     }
     Game.CurrentGame.NotificationProxy.NotifyWuGuStart(new DeckPlace(null, wuguFakeDeck));
     base.Process(source, dests, card, readonlyCard);
     Game.CurrentGame.NotificationProxy.NotifyWuGuEnd();
     Game.CurrentGame.Decks[null, wuguFakeDeck].Clear();
     if (Game.CurrentGame.Decks[null, wuguDeck].Count > 0)
     {
         move = new CardsMovement();
         move.Cards = new List<Card>(Game.CurrentGame.Decks[null, wuguDeck]);
         move.To = new DeckPlace(null, DeckType.Discard);
         Game.CurrentGame.MoveCards(move);
     }
 }
开发者ID:pxoylngx,项目名称:sgs,代码行数:35,代码来源:WuGuFengDeng.cs

示例5: Process

 public override void Process(Player source, List<Player> dests, ICard card, ReadOnlyCard cardr)
 {
     Trace.Assert(dests == null || dests.Count == 0);
     Trace.Assert(card is Card);
     Card c = (Card)card;
     Install(source, c);
 }
开发者ID:maplegh,项目名称:sgs,代码行数:7,代码来源:Equipment.cs

示例6: Process

 protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
 {
     DeckType wuguDeck = new DeckType("WuGu");
     DeckType wuguFakeDeck = new DeckType("WuGuFake");
     List<List<Card>> answer;
     if (!Game.CurrentGame.UiProxies[dest].AskForCardChoice(new CardChoicePrompt("WuGuFengDeng"),
             new List<DeckPlace>() { new DeckPlace(null, wuguFakeDeck) },
             new List<string>() { "WuGu" },
             new List<int>() { 1 },
             new WuGuCardChoiceVerifier(FakeMapping),
             out answer,
             new AdditionalCardChoiceOptions() { IsWuGu = true }))
     {
         Trace.TraceInformation("Invalid answer for WuGu, choosing for you");
         answer = new List<List<Card>>();
         answer.Add(new List<Card>());
         answer[0].Add(Game.CurrentGame.Decks[null, wuguDeck][0]);
     }
     else
     {
         if (!FakeMapping.ContainsKey(answer[0][0]) || FakeMapping[answer[0][0]] == null)
         {
             answer[0] = new List<Card>() { Game.CurrentGame.Decks[null, wuguDeck][0] };
         }
         var theCard = answer[0][0];
         answer[0] = new List<Card>() { FakeMapping[theCard] };
         FakeMapping[theCard] = null;
     }
     Game.CurrentGame.HandleCardTransferToHand(null, dest, answer[0], new MovementHelper() { IsWuGu = true });
 }
开发者ID:kingling,项目名称:sgs,代码行数:30,代码来源:WuGuFengDeng.cs

示例7: Process

 protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard)
 {
     if (dest.Health >= dest.MaxHealth)
     {
         return;
     }
     Game.CurrentGame.RecoverHealth(source, dest, 1);
 }
开发者ID:pxoylngx,项目名称:sgs,代码行数:8,代码来源:TaoYuanJieYi.cs

示例8: Process

 protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
 {
     if (readonlyCard[EatOneGetAnotherFreeCoupon] == 1)
     {
         Game.CurrentGame.RecoverHealth(source, dest, 2);
     }
     else
     {
         Game.CurrentGame.RecoverHealth(source, dest, 1);
     }
 }
开发者ID:h1398123,项目名称:sgs,代码行数:11,代码来源:Tao.cs

示例9: Process

 protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard)
 {
     if (Game.CurrentGame.IsDying.Count > 0)
     {
         Game.CurrentGame.RecoverHealth(source, dest, 1);
     }
     else
     {
         source[JiuUsed] = 1;
         source[Drank] = 1;
     }
 }
开发者ID:maplegh,项目名称:sgs,代码行数:12,代码来源:Jiu.cs

示例10: Process

 protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
 {
     if (Game.CurrentGame.DyingPlayers.Count > 0)
     {
         Game.CurrentGame.RecoverHealth(source, dest, 1);
     }
     else
     {
         dest[JiuUsed] = 1;
         dest[Drank] = 1;
     }
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:12,代码来源:Jiu.cs

示例11: Process

 protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
 {
     SingleCardUsageVerifier v1 = responseCardVerifier;
     List<Player> sourceList = new List<Player>();
     sourceList.Add(source);
     GameEventArgs args = new GameEventArgs();
     args.Source = dest;
     args.Targets = sourceList;
     args.Card = new CompositeCard();
     args.Card.Type = RequiredCard();
     args.ReadonlyCard = readonlyCard;
     try
     {
         Game.CurrentGame.Emit(GameEvent.PlayerRequireCard, args);
     }
     catch (TriggerResultException e)
     {
         if (e.Status == TriggerResult.Success)
         {
             Game.CurrentGame.HandleCardPlay(dest, args.Skill, args.Cards, sourceList);
             return;
         }
     }
     while (true)
     {
         IUiProxy ui = Game.CurrentGame.UiProxies[dest];
         ISkill skill;
         List<Player> p;
         List<Card> cards;
         if (!ui.AskForCardUsage(new CardUsagePrompt(UsagePromptString, source),
                                               v1, out skill, out cards, out p))
         {
             Trace.TraceInformation("Player {0} Invalid answer", dest);
             Game.CurrentGame.DoDamage(source.IsDead ? null : source, dest, 1, DamageElement.None, card, readonlyCard);
         }
         else
         {
             if (!Game.CurrentGame.HandleCardPlay(dest, skill, cards, sourceList))
             {
                 continue;
             }
             Trace.TraceInformation("Player {0} Responded. ", dest.Id);
         }
         break;
     }
 }
开发者ID:kingling,项目名称:sgs,代码行数:46,代码来源:Aoe.cs

示例12: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     ISkill skill;
     List<Card> cards;
     List<Player> players;
     DamageEventArgs args = eventArgs as DamageEventArgs;
     if (Game.CurrentGame.UiProxies[Owner].AskForCardUsage(new CardUsagePrompt("TianXiang"), new TianXiangVerifier(),
         out skill, out cards, out players))
     {
         NotifySkillUse(players);
         Game.CurrentGame.HandleCardDiscard(Owner, cards);
         ReadOnlyCard ncard = new ReadOnlyCard(args.ReadonlyCard);
         ncard[TianXiangDamage] = 1;
         players[0][TianXiangTarget]++;
         Game.CurrentGame.DoDamage(args.Source, players[0], Owner, args.Magnitude, args.Element, args.Card, ncard);
         throw new TriggerResultException(TriggerResult.End);
     }
 }
开发者ID:h1398123,项目名称:sgs,代码行数:18,代码来源:TianXiang.cs

示例13: Process

        protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
        {
            if (source.IsDead) return;
            if (dest.HandCards().Count + dest.Equipments().Count == 0) return; // ShunChai -> WuXie(from target) -> WuXie(soemone else) -> target has no card
            List<string> resultDeckPlace = new List<string>();
            resultDeckPlace.Add("GuoHeChaiQiao");
            List<int> resultDeckMax = new List<int>();
            resultDeckMax.Add(1);
            List<List<Card>> answer;
            bool doHandCard = true;
            if (dest.Equipments().Count != 0)
            {
                int result = 0;
                source.AskForMultipleChoice(new MultipleChoicePrompt("GuoHeChaiQiao2"), new List<OptionPrompt>() { new OptionPrompt("ShouPai"), new OptionPrompt("ZhuangBeiPai") }, out result);
                if (result == 1) doHandCard = false;
            }
            if (doHandCard)
            {
                Game.CurrentGame.SyncImmutableCards(source, Game.CurrentGame.Decks[dest, DeckType.Hand]);
                Game.CurrentGame.HandCardVisibility[source].Add(dest);
                var places = new List<DeckPlace>() { new DeckPlace(dest, DeckType.Hand) };
                if (!source.AskForCardChoice(new CardChoicePrompt("GuoHeChaiQiao2"), places, resultDeckPlace, resultDeckMax, new RequireOneCardChoiceVerifier(true), out answer))
                {
                    Trace.TraceInformation("Player {0} Invalid answer", source.Id);
                    answer = new List<List<Card>>();
                    answer.Add(Game.CurrentGame.PickDefaultCardsFrom(places));
                }
                foreach (Card c in dest.HandCards()) Game.CurrentGame.HideHandCard(c);
                Game.CurrentGame.HandCardVisibility[source].Remove(dest);
                Game.CurrentGame.HandleCardDiscard(dest, answer[0]);
            }
            else
            {
                var places = new List<DeckPlace>() { new DeckPlace(dest, DeckType.Equipment) };
                if (!source.AskForCardChoice(new CardChoicePrompt("GuoHeChaiQiao2"), places, resultDeckPlace, resultDeckMax, new RequireOneCardChoiceVerifier(true), out answer))
                {
                    Trace.TraceInformation("Player {0} Invalid answer", source.Id);
                    answer = new List<List<Card>>();
                    answer.Add(Game.CurrentGame.PickDefaultCardsFrom(places));
                }
                Game.CurrentGame.HandleCardDiscard(dest, answer[0]);

            }
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:44,代码来源:GuoHeChaiQiao2.cs

示例14: Process

        protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard)
        {
            DeckType wuguDeck = new DeckType("WuGu");
            List<List<Card>> answer;
            if (!Game.CurrentGame.UiProxies[dest].AskForCardChoice(new CardChoicePrompt("WuGuFengDeng"),
                    new List<DeckPlace>() { new DeckPlace(null, wuguDeck) },
                    new List<string>() { "WuGu" },
                    new List<int>() { 1 },
                    new RequireOneCardChoiceVerifier(),
                    out answer))
            {
                Trace.TraceInformation("Invalid answer for WuGu, choosing for you");
                answer = new List<List<Card>>();
                answer.Add(new List<Card>());
                answer[0].Add(Game.CurrentGame.Decks[null, wuguDeck][0]);
            }

            Game.CurrentGame.HandleCardTransferToHand(null, dest, answer[0]);
        }
开发者ID:maplegh,项目名称:sgs,代码行数:19,代码来源:WuGuFengDeng.cs

示例15: Process

        protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard)
        {
            IUiProxy ui = Game.CurrentGame.UiProxies[source];
            if (source.IsDead) return;
            List<DeckPlace> places = new List<DeckPlace>();
            places.Add(new DeckPlace(dest, DeckType.Hand));
            places.Add(new DeckPlace(dest, DeckType.Equipment));
            places.Add(new DeckPlace(dest, DeckType.DelayedTools));
            List<string> resultDeckPlace = new List<string>();
            resultDeckPlace.Add(ResultDeckName);
            List<int> resultDeckMax = new List<int>();
            resultDeckMax.Add(1);
            List<List<Card>> answer;
            int windowId = 0;
            if (!ui.AskForCardChoice(new CardChoicePrompt(ChoicePrompt), places, resultDeckPlace, resultDeckMax, new RequireOneCardChoiceVerifier(), out answer, new List<bool>() { false }, ref windowId))
            {
                Trace.TraceInformation("Player {0} Invalid answer", source.Id);
                answer = new List<List<Card>>();
                answer.Add(new List<Card>());
                var collection = Game.CurrentGame.Decks[dest, DeckType.Hand].Concat
                                 (Game.CurrentGame.Decks[dest, DeckType.DelayedTools].Concat
                                 (Game.CurrentGame.Decks[dest, DeckType.Equipment]));
                answer[0].Add(collection.First());
            }
            Card theCard = answer[0][0];
            Game.CurrentGame.SyncCardAll(ref theCard);
            Trace.Assert(answer.Count == 1 && answer[0].Count == 1);

            if (ShunChaiDest(source, dest).DeckType == DeckType.Discard)
            {
                Game.CurrentGame.HandleCardDiscard(dest, new List<Card>() { theCard });
            }
            else
            {
                Game.CurrentGame.HandleCardTransferToHand(dest, source, new List<Card>() { theCard });
            }
        }
开发者ID:kissgoodbye,项目名称:sgs,代码行数:37,代码来源:ShunChai.cs


注:本文中的Sanguosha.Core.Cards.ReadOnlyCard类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。