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


C# Player.DelayedTools方法代码示例

本文整理汇总了C#中Sanguosha.Core.Players.Player.DelayedTools方法的典型用法代码示例。如果您正苦于以下问题:C# Player.DelayedTools方法的具体用法?C# Player.DelayedTools怎么用?C# Player.DelayedTools使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sanguosha.Core.Players.Player的用法示例。


在下文中一共展示了Player.DelayedTools方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

 void Run(Player owner, GameEvent gameEvent, GameEventArgs args)
 {
     while (owner.HandCards().Count > 0 && owner.DelayedTools().Count > 0)
     {
         List<List<Card>> answer;
         List<DeckPlace> sourceDeck = new List<DeckPlace>();
         sourceDeck.Add(new DeckPlace(owner, DeckType.DelayedTools));
         sourceDeck.Add(new DeckPlace(owner, DeckType.Hand));
         AdditionalCardChoiceOptions options = new AdditionalCardChoiceOptions();
         options.IsCancellable = true;
         if (owner.AskForCardChoice(new CardChoicePrompt("XiuLuo", owner),
             sourceDeck,
             new List<string>() { "XLJinNang", "XLShouPai" },
             new List<int>() { 1, 1 },
             new XiuLuoVerifier(),
             out answer,
             options))
         {
             NotifySkillUse();
             Game.CurrentGame.HandleCardDiscard(owner, answer[1]);
             Game.CurrentGame.HandleCardDiscard(owner, answer[0]);
         }
         else break;
     }
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:25,代码来源:XiuLuo.cs

示例2: Process

        protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
        {
            IPlayerProxy ui = Game.CurrentGame.UiProxies[source];
            if (source.IsDead) return;
            if (dest.HandCards().Count + dest.Equipments().Count + dest.DelayedTools().Count == 0) return; // ShunChai -> WuXie(from target) -> WuXie(soemone else) -> target has no card
            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:RagingBigFemaleBird,项目名称:sgs,代码行数:31,代码来源:ShunChai.cs

示例3: SelectACardFrom

        public Card SelectACardFrom(Player from, Player ask, Prompt prompt, String resultdeckname, bool equipExcluded = false, bool delayedToolsExcluded = true, bool noReveal = false)
        {
            var deck = from.HandCards();
            if (!equipExcluded) deck = new List<Card>(deck.Concat(from.Equipments()));
            if (!delayedToolsExcluded) deck = new List<Card>(deck.Concat(from.DelayedTools()));
            if (deck.Count == 0) return null;
            List<DeckPlace> places = new List<DeckPlace>();
            places.Add(new DeckPlace(from, DeckType.Hand));
            if (!equipExcluded) places.Add(new DeckPlace(from, DeckType.Equipment));
            if (!delayedToolsExcluded) places.Add(new DeckPlace(from, DeckType.DelayedTools));
            List<List<Card>> answer;

            if (!ask.AskForCardChoice(prompt, places, new List<string>() { resultdeckname }, new List<int>() { 1 }, new RequireOneCardChoiceVerifier(noReveal), out answer))
            {
                Trace.TraceInformation("Player {0} Invalid answer", ask);
                answer = new List<List<Card>>();
                answer.Add(new List<Card>());
                answer[0].Add(deck.First());
            }
            Card theCard = answer[0][0];
            if (noReveal)
            {
                SyncCard(from, ref theCard);
            }
            else
            {
                SyncCardAll(ref theCard);
            }
            Trace.Assert(answer.Count == 1 && answer[0].Count == 1);
            return theCard;
        }
开发者ID:h1398123,项目名称:sgs,代码行数:31,代码来源:Game.Procedures.cs

示例4: VerifyPlayer

 protected override bool VerifyPlayer(Player source, Player player)
 {
     return player.HandCards().Count + player.Equipments().Count + player.DelayedTools().Count > 0;
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:4,代码来源:XianSi.cs


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