本文整理汇总了C#中CardType类的典型用法代码示例。如果您正苦于以下问题:C# CardType类的具体用法?C# CardType怎么用?C# CardType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CardType类属于命名空间,在下文中一共展示了CardType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CardPayment
//private bool ProcessCard(string cardnum, string amount, string cvv)
//{
// try
// {
// }
// catch
// {
// }
// return true;
//}
public CardPayment()
{
//Uncomment the following line if using designed components
//InitializeComponent();
_validateCardType = true;
_cardTypes = CardType.All | CardType.Unknown; // Accept everything
}
开发者ID:uwi-mase-2014-ccd,项目名称:component-farmers-intelligence-system-payment-services,代码行数:17,代码来源:CardPayment.cs
示例2: GetList
public List<BusinessPartnerGroup> GetList(CardType cardType)
{
StringBuilder oSQL = new StringBuilder();
oSQL.Append("SELECT GroupCode,GroupName FROM OCRG T0 ");
switch (cardType)
{
case CardType.Customer:
oSQL.Append(string.Format("where GroupType = '{0}' ", "C"));
break;
case CardType.Supplier:
oSQL.Append(string.Format("where GroupType = '{0}' ", "S"));
break;
case CardType.Lead:
oSQL.Append(string.Format("where GroupType = '{0}' ", "C"));
break;
default:
break;
}
DbCommand myCommand = this.dataBase.GetSqlStringCommand(oSQL.ToString());
List<BusinessPartnerGroup> partnerGroups = new List<BusinessPartnerGroup>();
using (this.reader = this.dataBase.ExecuteReader(myCommand))
{
while (this.reader.Read())
{
BusinessPartnerGroup partnerGroup = new BusinessPartnerGroup();
partnerGroup.groupCode = int.Parse(this.reader.GetValue(0).ToString());
partnerGroup.groupName = this.reader.IsDBNull(1) ? "" : this.reader.GetValue(1).ToString();
partnerGroups.Add(partnerGroup);
}
}
return partnerGroups;
}
示例3: Card
/// <summary>
/// Initializes a new instance of the Card class.
/// </summary>
/// <param name="CardType">Type of card to create.</param>
/// <param name="CardSuit">Suit of card to create.</param>
public Card(CardType CardType, CardSuit CardSuit)
{
m_Suit = CardSuit;
m_Type = CardType;
m_InternalValue = (int)CardType;
m_IsHigh = true;
}
示例4: Card
public Card(String name, String description, CardType cardType, int value)
{
this.name = name;
this.description = description;
this.cardType = cardType;
this.value = value;
}
示例5: IsValidType
private static bool IsValidType(string cardNumber, CardType cardType)
{
// Visa
if (Regex.IsMatch(cardNumber, "^(4)")
&& ((cardType & CardType.Visa) != 0))
return cardNumber.Length == 13 || cardNumber.Length == 16;
// MasterCard
if (Regex.IsMatch(cardNumber, "^(51|52|53|54|55)")
&& ((cardType & CardType.MasterCard) != 0))
return cardNumber.Length == 16;
// Amex
if (Regex.IsMatch(cardNumber, "^(34|37)")
&& ((cardType & CardType.Amex) != 0))
return cardNumber.Length == 15;
// Diners
if (Regex.IsMatch(cardNumber, "^(300|301|302|303|304|305|36|38)")
&& ((cardType & CardType.Diners) != 0))
return cardNumber.Length == 14;
//Unknown
if ((cardType & CardType.Unknown) != 0)
return true;
return false;
}
示例6: LengthOfFormattedStringTilLastGroupForType
public int LengthOfFormattedStringTilLastGroupForType (CardType type)
{
int idx = 0;
switch (type) {
case CardType.VISA:
case CardType.MASTERCARD:
case CardType.DISCOVER:
// { 4-4-4-4}
case CardType.MAESTRO:
idx = 16 + 3 - 4;
break;
case CardType.AMEX: // {4-6-5}
idx = 15 + 2 - 5;
break;
case CardType.DINERS_CLUB: // {4-6-4}
idx = 14 + 2 - 4;
break;
default:
idx = 0;
break;
}
return idx;
}
示例7: CardTypeToString
public static string CardTypeToString(CardType cardType)
{
string cardTypeAsString = null;
switch (cardType)
{
case CardType.Ace:
cardTypeAsString = "A";
break;
case CardType.King:
cardTypeAsString = "K";
break;
case CardType.Queen:
cardTypeAsString = "Q";
break;
case CardType.Jack:
cardTypeAsString = "J";
break;
case CardType.Ten:
cardTypeAsString = "10";
break;
case CardType.Nine:
cardTypeAsString = "9";
break;
case CardType.Eight:
cardTypeAsString = "8";
break;
case CardType.Seven:
cardTypeAsString = "7";
break;
}
return cardTypeAsString;
}
示例8: Card
public Card(
int id,
CardSet cardSet,
string name,
int cost,
int potionCost,
CardType cardType,
int additionalActions = 0,
int additionalBuys = 0,
int additionalCards = 0,
int additionalCoin = 0,
string actionText = null)
{
this.Id = id;
this.Set = cardSet;
this.Name = name;
this.Cost = cost;
this.PotionCost = potionCost;
this.Type = cardType;
this.ActionText = actionText;
AdditionalActions = additionalActions;
AdditionalBuys = additionalBuys;
AdditinalCards = additionalCards;
AdditionalCoin = additionalCoin;
}
示例9: Get
public static Card[] Get(CardType t, int amount)
{
CheckLoad();
CardPile<Card> pile;
List<Card> spent;
if (t == CardType.White) {
pile = _white;
spent = _whiteSpent;
} else {
pile = _black;
spent = _blackSpent;
}
Card[] draw;
try {
draw = pile.Draw(amount);
} catch (NotEnoughCardsException) {
pile.Add(spent);
spent.Clear();
draw = pile.Draw(amount); // No attempt is made to catch exception here
}
spent.AddRange(draw); // Drawn cards are now considered spent
return draw;
}
示例10: SetCardType
private void SetCardType()
{
if (Rating < 65)
CardType = CardType.Bronze;
else if (Rating < 75)
CardType = CardType.Silver;
}
示例11: checkCard
/// <summary>
/// Check card values to determine if they are right (i.e. are into allowed range for each property)
/// </summary>
/// <param name="_type">Card type as enum</param>
/// <param name="_class">Card class as enum</param>
/// <param name="_set">Card set as enum</param>
/// <param name="_race">Card race as enum</param>
/// <param name="_quality">Card quality as enum</param>
/// <returns></returns>
public static CardError checkCard(CardType _type, CardClass _class, CardSet _set, CardRace _race, CardQuality _quality, string _name)
{
if ((_type < CardType.Minion) || (_type > CardType.Weapon))
{
return CardError.BadType;
}
// Wrong card class?
if ((_class < CardClass.Neutral) || (_class > CardClass.Druid))
{
return CardError.BadClass;
}
// Wrong card set?
if ((_set < CardSet.Basic) || (_set > CardSet.WhispersOfTheOldGods))
{
return CardError.BadSet;
}
// Wrong minion race?
if ((_type == CardType.Minion) && ((_race < CardRace.None) || (_race > CardRace.Pirate)))
{
return CardError.BadRace;
}
// Wrong card quality?
if ((_quality < CardQuality.Free) || (_quality > CardQuality.Legendary))
{
return CardError.BadQuality;
}
// Wrong (empty) name?
if (_name.Length == 0)
{
return CardError.BadName;
}
return CardError.None;
}
示例12: Bonus
// Метод создания бонуса - ему присваиваются тип, младшая карта, а также опционно для бонусов типа "последовательность" - масть
public Bonus(BonusType Type, CardType HighCard, bool IsTrump, CardSuit Suit = CardSuit.C_NONE)
{
this.Type = Type;
this.HighCard = HighCard;
this.Suit = Suit;
this.IsTrump = IsTrump;
}
示例13: getResourceTypeFromString
public Boolean getResourceTypeFromString(string resourceType, out CardType type)
{
switch (resourceType)
{
case "Wood":
type = CardType.Wood;
break;
case "Sheep":
type = CardType.Sheep;
break;
case "Wheat":
type = CardType.Wheat;
break;
case "Rock":
type = CardType.Rock;
break;
case "Clay":
type = CardType.Clay;
break;
default:
type = CardType.Wood;
return false;
}
return true;
}
示例14: Card
protected GameScene gs;//游戏场景总管理
#region 构造函数
/// <summary>
/// 卡片构造函数
/// </summary>
public Card()
{
Init();
this.cardName = "";
this.cardType = CardType.Character;//默认为角色卡
this.cardRarity = CardRarity.Normal;
}
示例15: CardDesc
public CardDesc(
CardType type,
CardIndex index)
{
Type = type;
Number = index;
}