• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Rank类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: RankColor

 public static string RankColor(Rank rank)
 {
     if (colors.ContainsKey(rank)) {
         return colors[rank];
     } else {
         return Color.Black;
     }
 }
开发者ID:24500,项目名称:Spacecraft-GT,代码行数:8,代码来源:Ranks.cs


示例17: Digimon

 public Digimon(string nameRus, string nameEng, Rank rank, Type type, Speciality speciality)
 {
     NameEng = nameEng;
     NameRus = nameRus;
     Rank = rank;
     Type = type;
     Speciality = speciality;
 }
开发者ID:drdoomenator,项目名称:DW2DB,代码行数:8,代码来源:Digimon.cs


示例18: PlayerRankChangedEvent

 public PlayerRankChangedEvent(DateTime dateTime, Galaxy galaxy, string name, Rank oldRank, Rank newRank)
     : base(dateTime, galaxy)
 {
     OldRank = oldRank;
     NewRank = newRank;
     if (oldRank == newRank) throw new ArgumentException("Ranks must differ for player rank changed event");
     PlayerName = name;
 }
开发者ID:GoogleFrog,项目名称:Zero-K-Infrastructure,代码行数:8,代码来源:PlayerRankChangedEvent.cs


示例19: cSubstitute_SelectedIndexChanged

 private void cSubstitute_SelectedIndexChanged( object sender, EventArgs e ) {
     if( cSubstitute.SelectedIndex < 0 ) return;
     foreach( Rank rank in RankManager.Ranks ) {
         if( cSubstitute.SelectedItem.ToString() != rank.ToComboBoxOption() ) continue;
         substituteRank = rank;
         bDelete.Enabled = true;
         break;
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:DeleteRankPopup.cs


示例20: RankedBelow

 public static IEnumerable<Player> RankedBelow( this IEnumerable<Player> source, Rank maxRank ) {
     if( source == null ) throw new ArgumentNullException( "source" );
     if( maxRank == null ) throw new ArgumentNullException( "maxRank" );
     foreach( Player player in source ) {
         if( player.Info.Rank < maxRank ) {
             yield return player;
         }
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:PlayerEnumerable.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Rating类代码示例发布时间:2022-05-24
下一篇:
C# RangeCollection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap