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


C# Card.Count方法代码示例

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


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

示例1: MoveCardsToTable

        public static void MoveCardsToTable(Card[] cards, int[] x, int[] y, bool[] lFaceUp, int[] idx, bool isScriptMove)
        {
            if( cards.Length == 0 ) return;

            if (Program.GameEngine.Definition.Events.ContainsKey("OverrideCardsMoved") && !isScriptMove)
            {
                var tos = Enumerable.Repeat(Program.GameEngine.Table, cards.Count()).ToArray();
                Program.GameEngine.EventProxy.OverrideCardsMoved_3_1_0_2(cards, tos, idx, x, y);
                return;
            }
            Program.Client.Rpc.MoveCardAtReq(cards.Select(a => a.Id).ToArray(), x, y, idx, isScriptMove, lFaceUp);
            new MoveCards(Player.LocalPlayer, cards, x, y, idx, lFaceUp, isScriptMove).Do();
            foreach (var c in cards)
                Program.Client.Rpc.CardSwitchTo(Player.LocalPlayer, c, c.Alternate());
        }
开发者ID:octgn,项目名称:OCTGN,代码行数:15,代码来源:Card.cs

示例2: MoveCardsTo

 internal static void MoveCardsTo(Group to, Card[] cards, bool[] faceups, int[] idxs, bool isScriptMove)
 {
     var notMoved = new List<Card>();
     for (var i = 0; i < cards.Length; i++)
     {
         var c = cards[i];
         var lFaceUp = faceups[i];
         //converts negative indexes to count from the bottom for consistency with python behavior
         if (idxs[i] < 0) idxs[i] = to.Count + 1 + idxs[i];
         //over-large indecies reduced to place cards at end of pile
         if (idxs[i] >= to.Count) idxs[i] = to.Count;
         if (idxs[i] < 0) idxs[i] = 0;
         //move skipped if card already at location specified
         if (to == c.Group && idxs[i] < c.Group.Count && c.Group[idxs[i]] == c)
         {
             notMoved.Add(c);
             continue;
         }
         if (to.Visibility != GroupVisibility.Undefined) lFaceUp = c.FaceUp;
     }
     if (Program.GameEngine.Definition.Events.ContainsKey("OverrideCardsMoved") && !isScriptMove)
     {
         var xy = Enumerable.Repeat(0, cards.Count()).ToArray();
         var tos = Enumerable.Repeat(to, cards.Count()).ToArray();
         Program.GameEngine.EventProxy.OverrideCardsMoved_3_1_0_2(cards, tos, idxs, xy, xy);
         return;
     }
     Program.Client.Rpc.MoveCardReq(cards.Select(x => x.Id).ToArray(), to, idxs, faceups, isScriptMove);
     new MoveCards(Player.LocalPlayer, cards, to, idxs, faceups, isScriptMove).Do();
     foreach (var c in cards.Where(x => notMoved.Contains(x) == false))
         Program.Client.Rpc.CardSwitchTo(Player.LocalPlayer, c, c.Alternate());
 }
开发者ID:octgn,项目名称:OCTGN,代码行数:32,代码来源:Card.cs

示例3: UniqueCards

 private bool UniqueCards(Card[] allCardsFromDeck)
 {
     return allCardsFromDeck.All(c => allCardsFromDeck.Count(c.Equals) == 1);
 }
开发者ID:yakimovim,项目名称:Cards,代码行数:4,代码来源:DeckCreatorTests.cs


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