本文整理汇总了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(" ", "_");
}
示例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;
}
}
示例3: Bullet
public Bullet(Texture2D texture, Rank rank, Vector2 position, float direction)
{
this.position = position;
this.direction = direction;
this.texture = texture;
this.rank = rank;
}
示例4: GetLimitIndex
static int GetLimitIndex( Rank rank, Permission permission ) {
if( rank.HasLimitSet( permission ) ) {
return rank.GetLimit( permission ).Index + 1;
} else {
return 0;
}
}
示例5: MonteCarloModel
public MonteCarloModel(int rankCount, Rank[] ranks)
{
MyDistribution = new Distribution();
MyDistribution.RankCount = rankCount;
MyDistribution.Ranks = ranks;
Run();
}
示例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
}
示例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;
}
示例8: FindMainWorld
public static World FindMainWorld(Rank rank) {
World rankMain = rank.MainWorld;
if (rankMain != null) {
return rankMain;
}
return MainWorld;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例15: DigimonTemp
public DigimonTemp(string nameRus, string nameEng, string sourceCode, string resultCode, Rank rank)
{
NameRus = nameRus;
NameEng = nameEng;
SourceCode = sourceCode;
ResultCode = resultCode;
Rank = rank;
}