本文整理汇总了C#中CardType类的典型用法代码示例。如果您正苦于以下问题:C# CardType类的具体用法?C# CardType怎么用?C# CardType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CardType类属于命名空间,在下文中一共展示了CardType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:SilverioBernal,项目名称:OrkideaFramework,代码行数:34,代码来源:BusinessPartnerGroupData.cs
示例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;
}
开发者ID:SpectralCoding,项目名称:blackjack,代码行数:12,代码来源:Card.cs
示例4: Card
public Card(String name, String description, CardType cardType, int value)
{
this.name = name;
this.description = description;
this.cardType = cardType;
this.value = value;
}
开发者ID:StevenCurran,项目名称:Monopoly,代码行数:7,代码来源:Card.cs
示例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;
}
开发者ID:algola,项目名称:backup,代码行数:28,代码来源:CreditCardAttribute.cs
示例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;
}
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:26,代码来源:CreditCard.cs
示例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;
}
开发者ID:emsto,项目名称:JustBelot,代码行数:32,代码来源:CardsHelper.cs
示例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;
}
开发者ID:GunioRobot,项目名称:Dominionizer,代码行数:26,代码来源:Card.cs
示例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;
}
开发者ID:Rafa652,项目名称:GameChannel,代码行数:25,代码来源:CardManager.cs
示例10: SetCardType
private void SetCardType()
{
if (Rating < 65)
CardType = CardType.Bronze;
else if (Rating < 75)
CardType = CardType.Silver;
}
开发者ID:kauefelipe,项目名称:FIFA-Ultimate-Team-2014-Toolkit,代码行数:7,代码来源:Item.cs
示例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;
}
开发者ID:hugojcastro,项目名称:HSCardCreator,代码行数:42,代码来源:General.cs
示例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;
}
开发者ID:TawaSystems,项目名称:belotetest,代码行数:8,代码来源:Bonus.cs
示例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;
}
开发者ID:Lepercon5000,项目名称:socsim,代码行数:25,代码来源:APIHelper.cs
示例14: Card
protected GameScene gs;//游戏场景总管理
#region 构造函数
/// <summary>
/// 卡片构造函数
/// </summary>
public Card()
{
Init();
this.cardName = "";
this.cardType = CardType.Character;//默认为角色卡
this.cardRarity = CardRarity.Normal;
}
开发者ID:zhutaorun,项目名称:ACGCard-for-Unity3D,代码行数:13,代码来源:Card.cs
示例15: CardDesc
public CardDesc(
CardType type,
CardIndex index)
{
Type = type;
Number = index;
}
开发者ID:jmsnapc,项目名称:test-project,代码行数:7,代码来源:GameObjects.cs
示例16: StandardCard
private StandardCard(CardType cardType, string name, string description, Func<IPlayer, IFightResult> action)
{
this.CardType = cardType;
this.Name = name;
this.Description = description;
this._action = action;
}
开发者ID:spolnik,项目名称:Magiczny_Miecz_Game,代码行数:7,代码来源:StandardCard.cs
示例17:
// Обращение к карте по ее типу и масти
public Card this[CardType type, CardSuit suit]
{
get
{
return list.Find(c => (c.Type == type) && (c.Suit == suit));
}
}
开发者ID:TawaSystems,项目名称:belotetest,代码行数:8,代码来源:CardList.cs
示例18: Initialise
public void Initialise (string _name, int _manaCost, CardType _cardType, CardEffectName _cfn, int _coolDown) {
this.cardEffectName = _cfn;
name = _name;
manaCost = _manaCost;
cardType = _cardType;
cooldown = _coolDown;
}
开发者ID:divinekoala,项目名称:CardGame,代码行数:7,代码来源:SpellCard.cs
示例19: TopOfDeckSource
public TopOfDeckSource(Player player, CardType type)
{
Player = player;
_type = type;
_decks = Player.Game.Village.Decks;
_all = false;
}
开发者ID:Slugburn,项目名称:Thunderstone,代码行数:7,代码来源:TopOfDeckSource.cs
示例20: Is
public void Is()
{
var type = new CardType("Basic Land - Island");
Assert.True(type.BasicLand);
Assert.True(type.Is("land"));
Assert.True(type.Is("basic land"));
Assert.True(type.Is("island"));
}
开发者ID:leloulight,项目名称:magicgrove,代码行数:8,代码来源:CardTypeFacts.cs
注:本文中的CardType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论