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


C# Rank类代码示例

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


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

示例1: Card

       // Card constructor using enumerated types.
       public Card (Suits suit, Rank rank)
       {
           this.suit = suit;
           this.rank = rank;
           description = this.ToString().ToLower().Replace(" ", "_");
 
       }
开发者ID:ryancnap,项目名称:Kings,代码行数:8,代码来源:Cards.cs

示例2: PokerHand

 public PokerHand(string cards)
 {
     var pokerCards = cards.Split(' ').Select(cardValue => new PokerCard(cardValue)).ToList();
     pokerCards.Sort();
     var groups = from card in pokerCards group card by card.Denomination;
     switch (groups.Count())
     {
         case 4:
             Rank = Rank.Pair;
             break;
         case 3:
             Rank = Rank.TwoPairs;
             break;
         case 2:
             Rank = Rank.FullHouse;
             break;
         case 5:
             Rank = Rank.Straight;
             for (int i = 1; i < pokerCards.Count; i++)
             {
                 if (pokerCards[i].Denomination - pokerCards[i - 1].Denomination != 1)
                 {
                     Rank = Rank.UNKNOWN;
                     break;
                 }
             }
             break;
         default:
             Rank = Rank.UNKNOWN;
             break;
     }
 }
开发者ID:NNUGKrs,项目名称:Katas,代码行数:32,代码来源:PokerHand.cs

示例3: Bullet

 public Bullet(Texture2D texture, Rank rank, Vector2 position, float direction)
 {
     this.position = position;
     this.direction = direction;
     this.texture = texture;
     this.rank = rank;
 }
开发者ID:BitSits,项目名称:BitSits-Framework---Squares-Vs-Triangles,代码行数:7,代码来源:Bullet.cs

示例4: GetLimitIndex

 static int GetLimitIndex( Rank rank, Permission permission ) {
     if( rank.HasLimitSet( permission ) ) {
         return rank.GetLimit( permission ).Index + 1;
     } else {
         return 0;
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:7,代码来源:PermissionLimitBox.cs

示例5: MonteCarloModel

 public MonteCarloModel(int rankCount, Rank[] ranks)
 {
     MyDistribution = new Distribution();
     MyDistribution.RankCount = rankCount;
     MyDistribution.Ranks = ranks;
     Run();
 }
开发者ID:leoslopez,项目名称:SimulacionLluvia,代码行数:7,代码来源:MonteCarloModel.cs

示例6: UpdateRankingForSpecificUser

        public void UpdateRankingForSpecificUser(aspnet_User user, int uid)
        {
            int NoAccepted = uvareq.GetUvaUserSolvedProblems(uid);
            Rank userRank;

            try
            {
                if ( user.Rank != null)
                {
                    user.Rank.Solved = NoAccepted;
                }
                else
                {

                    userRank = new Rank()
                    {
                        IdUser = user.UserId,
                        UvaUserName = user.UserName,
                        Solved = NoAccepted
                    };

                    modx.Ranks.InsertOnSubmit(userRank);

                }

                modx.SubmitChanges();
            }
            catch (NullReferenceException ex)
            {

            }
            //test if null then same solved
        }
开发者ID:juanto121,项目名称:CPCUPB,代码行数:33,代码来源:Datamanager.cs

示例7: Has

 /// <summary>
 /// Determines whether [has] [the specified rank].
 /// </summary>
 /// <param name="rank">The rank.</param>
 /// <param name="suit">The suit.</param>
 /// <returns>
 ///   <c>true</c> if [has] [the specified rank]; otherwise, <c>false</c>.
 /// </returns>
 public bool Has(Rank rank, Suit suit)
 {
     if (GetCard(rank, suit) != null)
         return true;
     else
         return false;
 }
开发者ID:anorsich,项目名称:dds.net,代码行数:15,代码来源:Deck.cs

示例8: FindMainWorld

 public static World FindMainWorld(Rank rank) {
     World rankMain = rank.MainWorld;
     if (rankMain != null) {
         return rankMain;
     }
     return MainWorld;
 }
开发者ID:Magi1053,项目名称:ProCraft,代码行数:7,代码来源:WorldManager.cs

示例9: Follows

        private bool Follows(Rank lower, Rank higher)
        {
            //Special case, 2 follows ace
            if (lower == Rank.ACE && higher == Rank.DEUCE)
                return true;

            return (int)lower + 1 == (int)higher;
        }
开发者ID:nitell,项目名称:PokerClient,代码行数:8,代码来源:HandEvaluator.cs

示例10: Card

 public Card(Rank rank, Suit suit)
     : this()
 {
     if (suit == Suit.None)
         throw new ArgumentException("Suit cannot be none", "suit");
     this.Rank = rank;
     this.Suit = suit;
 }
开发者ID:rsarwas,项目名称:BridgeIt,代码行数:8,代码来源:Card.cs

示例11: Member

 public Member(String name, Rank rank = Rank.Member, int groupId = -1)
 {
     Random rand = new Random();
     this.ID = rand.Next();
     this.VillageName = name;
     this.Rank = rank;
     this.GroupId = groupId;
 }
开发者ID:enristerling,项目名称:PaperCactus,代码行数:8,代码来源:Member.cs

示例12: MonteCarloModel

 public MonteCarloModel(int rankCount, Rank[] ranks, double mean, double std_dev)
 {
     _mean = mean;
     _std_dev = std_dev;
     MyDistribution = new Distribution(new SimulationData(), 0);
     MyDistribution.Ranks = ranks;
     Run();
 }
开发者ID:InvestOp-Workers,项目名称:FuzzyRain,代码行数:8,代码来源:MonteCarloModel.cs

示例13: AddUnrecognizedPlayer

 /// <summary> Adds a new PlayerInfo entry for a player who has never been online, by name. </summary>
 /// <returns> A newly-created PlayerInfo entry. </returns>
 public PlayerInfo AddUnrecognizedPlayer( string name, Rank startingRank, RankChangeType rankChangeType ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     if( startingRank == null ) throw new ArgumentNullException( "startingRank" );
     int id = GetNextID();
     PlayerInfo info = new PlayerInfo( id, name, startingRank, rankChangeType, false );
     trie.Add( name, info );
     return info;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:FlatfilePlayerDBProvider.cs

示例14: AddPlayer

 /// <summary> Adds a new PlayerInfo entry for an actual, logged-in player. </summary>
 /// <returns> A newly-created PlayerInfo entry. </returns>
 public PlayerInfo AddPlayer( string name, Rank startingRank, RankChangeType rankChangeType, IPAddress address ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     if( address == null ) throw new ArgumentNullException( "address" );
     int id = GetNextID();
     PlayerInfo info = new PlayerInfo( id, name, startingRank, rankChangeType, address );
     trie.Add( name, info );
     return info;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:FlatfilePlayerDBProvider.cs

示例15: DigimonTemp

 public DigimonTemp(string nameRus, string nameEng, string sourceCode, string resultCode, Rank rank)
 {
     NameRus = nameRus;
     NameEng = nameEng;
     SourceCode = sourceCode;
     ResultCode = resultCode;
     Rank = rank;
 }
开发者ID:drdoomenator,项目名称:DW2DB,代码行数:8,代码来源:DNATables.cs


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