當前位置: 首頁>>代碼示例>>C#>>正文


C# CardType類代碼示例

本文整理匯總了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;
        }
開發者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


注:本文中的CardType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。