//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
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
    protected GameScene gs;//游戏场景总管理

    #region 构造函数
    /// <summary>
    /// 卡片构造函数
    /// </summary>
    public Card()
    {
        Init();
        this.cardName = "";
        this.cardType = CardType.Character;//默认为角色卡
        this.cardRarity = CardRarity.Normal;
    }
Exemplo n.º 4
0
 public TopOfDeckSource(Player player, CardType type)
 {
     Player = player;
     _type = type;
     _decks = Player.Game.Village.Decks;
     _all = false;
 }
        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;
        }
Exemplo n.º 6
0
	public void Initialise (string _name, int _manaCost, CardType _cardType, CardEffectName _cfn, int _coolDown) {
		this.cardEffectName = _cfn;
		name = _name;
		manaCost = _manaCost;
		cardType = _cardType;
		cooldown = _coolDown;
	}
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 9
0
 private StandardCard(CardType cardType, string name, string description, Func<IPlayer, IFightResult> action)
 {
     this.CardType = cardType;
     this.Name = name;
     this.Description = description;
     this._action = action;
 }
Exemplo n.º 10
0
 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;
 }
Exemplo n.º 11
0
        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;
        }
Exemplo n.º 12
0
 /// <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;
 }
Exemplo n.º 13
0
 // Обращение к карте по ее типу и масти
 public Card this[CardType type, CardSuit suit]
 {
     get
     {
         return list.Find(c => (c.Type == type) && (c.Suit == suit));
     }
 }
Exemplo n.º 14
0
        public CardDesc(
			CardType type,
			CardIndex index)
        {
            Type = type;
            Number = index;
        }
Exemplo n.º 15
0
 // Метод создания бонуса - ему присваиваются тип, младшая карта, а также опционно для бонусов типа "последовательность" - масть
 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;
 }
Exemplo n.º 16
0
 public Card(String name, String description, CardType cardType, int value)
 {
     this.name = name;
     this.description = description;
     this.cardType = cardType;
     this.value = value;
 }
Exemplo n.º 17
0
		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;
		}
Exemplo n.º 18
0
 public void Update(PlayingCardState other)
 {
     base.Update(other);
     this.Type = other.Type;
     this.Rank = other.Rank;
     this.Suit = other.Suit;
 }
 private void SetCardType()
 {
     if (Rating < 65)
         CardType = CardType.Bronze;
     else if (Rating < 75)
         CardType = CardType.Silver;
 }
Exemplo n.º 20
0
 /// <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;
 }
Exemplo n.º 21
0
 protected CharacterCardBase(CardType printedCardType, string title, CardSet cardSet, uint cardNumber, Sphere printedSphere, byte printedWillpower, byte printedAttack, byte printedDefense, byte printedHitPoints)
     : base(printedCardType, title, cardSet, cardNumber, printedSphere)
 {
     this.PrintedWillpower = printedWillpower;
     this.PrintedAttack = printedAttack;
     this.PrintedDefense = printedDefense;
     this.PrintedHitPoints = printedHitPoints;
 }
Exemplo n.º 22
0
 private string TranslateCardType(CardType cardType)
 {
     switch (cardType) {
         case CardType.Mastercard: return ("MC");
         case CardType.Visa: return ("VISA");
     }
     throw (new NotImplementedException("Only Visa and Mastercard currently supported!"));
 }
Exemplo n.º 23
0
		protected override MsrFieldData ParseMsrFieldData(byte[] track1Data, byte[] track2Data, byte[] track3Data, byte[] track4Data, CardType cardType)
		{
			string Track1Data = ByteArrayToString(RemoveSentinels(track1Data, '%', '?'));
			string Track2Data = ByteArrayToString(RemoveSentinels(track2Data, ';', '?'));

			// Parse Iso data
			return MsrDataParser.ParseIsoData(Track1Data, Track2Data);
		}
Exemplo n.º 24
0
    private CardType type; //卡牌花色

    #endregion Fields

    #region Constructors

    public CardData()
    {
        this.coslay = CardCosplay.None;
        this.type = CardType.None;
        this.number = 0;
        this.id = 0;
        this.pos = 0;
    }
Exemplo n.º 25
0
 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"));
 }
Exemplo n.º 26
0
 public override bool LoadFromTabData(TabData tabData)
 {
     cardName = tabData.ReadString("CardName");
     description = tabData.ReadString("Description");
     type = (CardType)tabData.ReadInt("CardType");
     cost = tabData.ReadInt("Cost");
     return true;
 }
Exemplo n.º 27
0
 /// <summary>Initialize a new instance of <see cref="PaymentCard"/> based on the supplied values.</summary>
 /// <param name="cardHolder">The full cardholder name, as it appears on the payment card.</param>
 /// <param name="cardNumber">The PAN number - the long number across the front of the card</param>
 /// <param name="expiryDate">The card expiry date</param>
 /// <param name="cv2">The Card Verification Value or 'signature digits' from the payment card.</param>
 /// <param name="cardType"></param>
 public PaymentCard(string cardHolder, string cardNumber, CardDate expiryDate, string cv2, CardType cardType)
 {
     this.CardHolder = cardHolder;
     this.CardNumber = cardNumber;
     this.ExpiryDate = expiryDate;
     this.CV2 = cv2;
     this.CardType = cardType;
 }
Exemplo n.º 28
0
 public CardData(CardCosplay coslay, CardType type, int number )
 {
     this.coslay = coslay;
     this.type = type;
     this.number = number;
     this.id = (int)(this.type) * Const.CARD_TYPE_BIT + number;
     this.pos = 0;
 }
Exemplo n.º 29
0
 public static VillageSectionModel Create(Game game, string sectionName, CardType type)
 {
     return new VillageSectionModel
         {
             SectionName = sectionName,
             Decks = game.Village[type].Select(DeckModel.From)
         };
 }
Exemplo n.º 30
0
 protected CardBase(string title, CardType type, CardSet set)
 {
     if (title == null)
         throw new ArgumentNullException("title");
     
     this.title = title;
     this.type = type;
     this.set = set;
 }
Exemplo n.º 31
0
 public Card(CardType cardType, CountryName countryName)
 {
     CardType    = cardType;
     CountryName = countryName;
 }
Exemplo n.º 32
0
        public int InsertRow(CardType CardType)
        {
            DbTransaction Tran = null;

            return(InsertRow(Tran, CardType));
        }
Exemplo n.º 33
0
 public Card(CardColor c, CardType t)
 {
     color = c;
     type  = t;
 }
Exemplo n.º 34
0
 public Card(CardType type, String title, String body)
 {
     this.type  = type;
     this.title = title;
     this.body  = body;
 }
Exemplo n.º 35
0
        public int UpdateRow(CardType CardType)
        {
            DbTransaction Tran = null;

            return(UpdateRow(Tran, CardType));
        }
Exemplo n.º 36
0
 public bool IsOfType(CardType type)
 {
     return((CardType)GetTag(GameTag.CARDTYPE) == type);
 }
Exemplo n.º 37
0
        public CardTypeViewModel(ICardGameDataStore cardGameDataStore, IDialogService dialogService, CardType original, Action <bool> updateCallback)
        {
            _dialogService     = dialogService;
            _updateCallback    = updateCallback;
            _cardGameDataStore = cardGameDataStore ?? throw new ArgumentNullException(nameof(cardGameDataStore));
            _original          = original;
            _layoutViewModel   = new LayoutViewModel(cardGameDataStore, _dialogService, this);
            LoadAttributes();

            _clone = new CardType
            {
                Id   = _original.Id,
                Name = _original.Name
            };
        }
                            public CardModelInfo(int cardId, string level, string cardName, string describe, string ability, string cardTag, CardType cardType, Sectarian sectarian, CardRank rank, Region cardProperty, Territory cardTerritory, int point, int ramification, Texture2D icon)
                            {
                                this.icon     = icon;
                                this.cardId   = cardId;
                                this.level    = level;
                                this.cardName = cardName;
                                this.describe = describe;
                                this.ability  = ability;
                                this.cardTag  = String.Join(" ", cardTag.Split(' ').Select(x => x.TransTag()));
                                Debug.LogError(cardTag + "--" + this.cardTag);

                                this.point         = point;
                                this.cardType      = cardType;
                                this.sectarian     = sectarian;
                                this.cardProperty  = cardProperty;
                                this.cardTerritory = cardTerritory;
                                this.cardRank      = rank;
                                CardLibraryCommand.CreatScript(cardId);
                            }
Exemplo n.º 39
0
        private void CardEnterWait(CardType cardType)
        {
            Packet p = _PacketCreater.CreateCardEnterWaitPacket(Address, cardType);

            _CommComponent.SendPacket(p);
        }
Exemplo n.º 40
0
        /// <summary>
        /// 获得声音文件的标记名字部分
        /// </summary>
        /// <param name="cards"></param>
        /// <param name="cardType">获得的牌值(包括花色的)</param>
        /// <returns></returns>
        public static string GetAudioName(int[] cards, CardType cardType)
        {
            var str = new string[cards.Length];

            for (int i = 0; i < cards.Length; i++)
            {
                str[i] = cards[i].ToString("x").Substring(1, 1);
            }
            System.Array.Sort(str);

            switch (cardType)
            {
            case CardType.C1:
                if (cards[0] == 81)
                {
                    return("xiaowang");
                }
                if (cards[0] == 97)
                {
                    return("dawang");
                }
                return(str[0]);

            case CardType.C123:
                if (str[0] == str[1] && str[1] != str[2])
                {
                    return("shuangshun");                                            //查看是否是双顺
                }
                return("shunzi");

            case CardType.C1122:
                return("shuangshun");

            case CardType.C111222:
                return("feiji");

            case CardType.C1112223344:
            case CardType.C11122234:
                return("feijidaichibang");

            case CardType.C2:
                if (cards[0] == 97 || cards[1] == 97 || cards[0] == 81 || cards[1] == 81)
                {
                    return("huojian");
                }
                if (str[0] == str[1] || HaveMagic(cards))
                {
                    if (HaveMagic(cards))
                    {
                        return("1dui" + str[1]);
                    }
                    return("1dui" + str[0]);
                }
                return("1dui" + str[1]);

            case CardType.C3:
                return("3zhang" + str[1]);

            case CardType.C31:
                return("3dai1");

            case CardType.C32:
                return("3dai2");


            case CardType.C4:
                if (HaveMagic(cards))         //如果有癞子
                {
                    if (str[1] == str[2] && str[2] == str[3])
                    {
                        return("zhadan");
                    }
                }
                return(str[0] != str[3] ? "3dai1" : "zhadan");

            case CardType.C411:
                return("4dai2");

            case CardType.C42:
                return("huojian");

            case CardType.C5:
                //超级炸弹
                break;
            }
            return(string.Empty);
        }
Exemplo n.º 41
0
        /// <summary>
        /// Parses the response received from the server.
        /// </summary>
        protected override void UnpackResponse()
        {
            base.UnpackResponse();

            // Create the streams we will be reading from.
            MemoryStream responseStream = new MemoryStream(m_responsePayload);
            BinaryReader responseReader = new BinaryReader(responseStream, Encoding.Unicode);

            // Check the response length.
            if (responseStream.Length < MinResponseMessageLength)
            {
                throw new MessageWrongSizeException("Get Game Cards");
            }

            // Try to unpack the data.
            try
            {
                // Seek past return code.
                responseReader.BaseStream.Seek(sizeof(int), SeekOrigin.Begin);

                // Same Cards
                m_sameCards = responseReader.ReadBoolean();

                // Consecutive Cards
                m_consecutiveCards = responseReader.ReadBoolean();

                // Get the count of games.
                ushort gameCount = responseReader.ReadUInt16();

                // Clear any existing games.
                m_games.Clear();

                // Read all the game data.
                for (ushort currentGame = 0; currentGame < gameCount; currentGame++)
                {
                    BingoGame game = new BingoGame();

                    // Game Number
                    game.LinearNumber = responseReader.ReadInt32();

                    // Display Game Number
                    game.DisplayNumber = responseReader.ReadInt32();

                    // Game Type Id
                    game.Type = (GameType)responseReader.ReadInt32();

                    // Set whether this game has consecutive cards.
                    game.ConsecutiveCards = m_consecutiveCards;

                    // Get the count of card types.
                    ushort cardTypeCount = responseReader.ReadUInt16();

                    for (ushort currentType = 0; currentType < cardTypeCount; currentType++)
                    {
                        // Card Type Id
                        CardType cardType = (CardType)responseReader.ReadInt32();

                        // Rally DE2312 - Selling CBB cards returns an error.
                        CardMedia mediaType = (CardMedia)responseReader.ReadInt32();

                        // Get the count of levels.
                        ushort levelCount = responseReader.ReadUInt16();

                        for (ushort currentLevel = 0; currentLevel < levelCount; currentLevel++)
                        {
                            // Card Level Id
                            int cardLevelId = responseReader.ReadInt32();

                            // Rally US505
                            CardLevel level = null;

                            if (game.Type != GameType.CrystalBall && game.Type != GameType.PickYurPlatter) // Rally TA6385
                            {
                                // Try to find the level in the array we have.
                                if (m_levels == null || m_levels.Length == 0)
                                {
                                    throw new ModuleException(Resources.UnknownCardLevel);
                                }

                                foreach (CardLevel lvl in m_levels)
                                {
                                    if (lvl.Id == cardLevelId)
                                    {
                                        level = lvl;
                                        break;
                                    }
                                }

                                // Rally US229 & US505
                                if (level == null)
                                {
                                    throw new ModuleException(Resources.UnknownCardLevel);
                                }
                            }

                            // Get the count of cards.
                            ushort cardCount = responseReader.ReadUInt16();

                            for (ushort currentCard = 0; currentCard < cardCount; currentCard++)
                            {
                                BingoCard card = null;

                                // Rally TA5749
                                // First Card
                                bool firstCard = responseReader.ReadBoolean();

                                // Card Number
                                int cardNum = responseReader.ReadInt32();

                                // PDTS 1098
                                // Rally DE2312
                                // Create the card.
                                card                = BingoCardFactory.CreateBingoCard(game.Type, cardType, mediaType);
                                card.Number         = cardNum;
                                card.Level          = level;
                                card.IsStartingCard = firstCard;
                                // END: TA5749

                                // Rally US505
                                // Rally TA6385
                                if (m_getFaces || game.Type == GameType.CrystalBall || game.Type == GameType.PickYurPlatter)
                                {
                                    // Rally US498
                                    card.ParseFaceData(responseReader);
                                }

                                game.AddCard(card);
                            }
                        }
                    }

                    m_games.Add(game);
                }
            }
            catch (EndOfStreamException e)
            {
                throw new MessageWrongSizeException("Get Game Cards", e);
            }
            catch (Exception e)
            {
                throw new ServerException("Get Game Cards", e);
            }

            // Close the streams.
            responseReader.Close();
        }
Exemplo n.º 42
0
        /// <summary>Creates new card registration object.</summary>
        /// <param name="cardType">Card type.</param>
        /// <returns>CardRegistration instance returned from API.</returns>
        protected CardRegistrationDTO GetNewJohnsCardRegistration(CardType cardType = CardType.CB_VISA_MASTERCARD)
        {
            BaseTest._johnsCardRegistration = null;

            return(GetJohnsCardRegistration(cardType));
        }
Exemplo n.º 43
0
 public BasicCard(int value, Signs sign, CardType cardType)
 {
     Value    = value;
     CardType = cardType;
     Value    = value;
 }
Exemplo n.º 44
0
 public Card GetCard(CardType type, Suit suit)
 {
     return(Cards.Find(c => c.Type == type && c.Suit == suit));
 }
Exemplo n.º 45
0
 public bool HasType(CardType type)
 {
     return((Type & (int)type) != 0);
 }
Exemplo n.º 46
0
 public Card(CardSuit suit, CardType type)
 {
     this.Suit = suit;
     this.Type = type;
 }
Exemplo n.º 47
0
        protected override MsrTrackData ParseMsrTrackData(byte[] track1Data, byte[] track2Data, byte[] track3Data, byte[] track4Data, CardType cardType)
        {
            MsrTrackData data = new MsrTrackData();

            if (TransmitSentinels)
            {
                // Raw data contains sentinels so just pass it through
                data.Track1Data = (byte[])track1Data.Clone();
                data.Track2Data = (byte[])track2Data.Clone();
                data.Track3Data = (byte[])track3Data.Clone();
            }
            else
            {
                /// remove sentinels
                data.Track1Data = RemoveSentinels(track1Data, '%', '?');
                data.Track2Data = RemoveSentinels(track2Data, ';', '?');

                // ISO sentinels are differnt than AAMVA
                data.Track3Data = RemoveSentinels(RemoveSentinels(track3Data, ';', '?'), '%', '?');;
            }
            data.Track4Data = null;

            return(data);
        }
Exemplo n.º 48
0
 public Evolve(string _cardId, string _name, string _imgURL, int _cost, string _rawDescription, CardType _cardType, CardRarity _cardRarity, CardTarget _cardTarget, DamageType _damageType) : base(_cardId, _name, _imgURL, _cost, _rawDescription, _cardType, _cardRarity, _cardTarget, _damageType)
 {
 }
Exemplo n.º 49
0
        /// <summary>
        /// 检查出的牌,播放相应的粒子特效
        /// </summary>
        /// <param name="cdType">卡牌类型</param>
        public void CheckPartiCalPlay(CardType cdType)
        {
            switch (cdType)
            {
            case CardType.C123:
            {
                ParticalShunzi.SetActive(true);
                ParticalShunzi.GetComponent <ParticleSystem>().Stop();
                ParticalShunzi.GetComponent <ParticleSystem>().Play();
                break;
            }

            case CardType.C1122:
            {
                ParticalLianDui.SetActive(true);
                ParticalLianDui.GetComponent <ParticleSystem>().Stop();
                ParticalLianDui.GetComponent <ParticleSystem>().Play();
                break;
            }

            case CardType.C111222:
            {
                ParticalFeiji.SetActive(false);
                StopCoroutine("HideFeiji");
                ParticalFeiji.SetActive(true);
                StartCoroutine(HideFeiji());
                break;
            }

            case CardType.C1112223344:
            {
                ParticalFeiji.SetActive(false);
                StopCoroutine("HideFeiji");
                ParticalFeiji.SetActive(true);
                StartCoroutine(HideFeiji());
                break;
            }

            case CardType.C11122234:
            {
                ParticalFeiji.SetActive(false);
                StopCoroutine("HideFeiji");
                ParticalFeiji.SetActive(true);
                StartCoroutine(HideFeiji());
                break;
            }

            case CardType.C4:
            {
                ParticalZhadan.SetActive(true);
                ParticalZhadan.GetComponent <ParticleSystem>().Stop();
                ParticalZhadan.GetComponent <ParticleSystem>().Play();
                break;
            }

            case CardType.C42:
            {
                ParticalWangZha.SetActive(true);
                ParticalWangZha.GetComponent <ParticleSystem>().Stop();
                ParticalWangZha.GetComponent <ParticleSystem>().Play();
                break;
            }
            }
        }
Exemplo n.º 50
0
 public BuringPact(string _cardId, string _name, string _imgURL, int _cost, string _rawDescription, CardType _cardType, CardRarity _cardRarity, CardTarget _cardTarget) : base(_cardId, _name, _imgURL, _cost, _rawDescription, _cardType, _cardRarity, _cardTarget)
 {
 }
Exemplo n.º 51
0
        protected override MsrFieldData ParseMsrFieldData(byte[] track1Data, byte[] track2Data, byte[] track3Data, byte[] track4Data, CardType cardType)
        {
            string Track1Data = ByteArrayToString(RemoveSentinels(track1Data, '%', '?'));
            string Track2Data = ByteArrayToString(RemoveSentinels(track2Data, ';', '?'));
            string Track3Data = ByteArrayToString(RemoveSentinels(RemoveSentinels(track3Data, '%', '?'), ';', '?'));


            // Parse Iso data
            if (cardType == Microsoft.PointOfService.BaseServiceObjects.CardType.Iso)
            {
                return(MsrDataParser.ParseIsoData(Track1Data, Track2Data));
            }
            else
            {
                return(MsrDataParser.ParseAamvaData(Track1Data, Track2Data, Track3Data));
            }
        }
Exemplo n.º 52
0
 public static Task <IList <GameCard> > GetSelectPlanceCards(this GameCard card, Func <GameCard, bool> filter = null, SelectModeType selectMode = SelectModeType.AllRow, bool isEnemySwitch = false, CardType selectType = CardType.Unit, int count = 1, int range = 0, bool isHasConceal = false)
 {
     return(card.Game.GetSelectPlaceCards(card, count, isEnemySwitch, filter, selectMode, selectType, range, isHasConceal));
 }
Exemplo n.º 53
0
        protected void dlAddress_UpdateCommand(object sender, DataListCommandEventArgs e)
        {
            CreditCardPanel ctrlCreditCard = e.Item.FindControl("ctrlCreditCard") as CreditCardPanel;
            Panel           pnlCCData      = e.Item.FindControl("pnlCCData") as Panel;
            Panel           pnlECData      = e.Item.FindControl("pnlECData") as Panel;

            AddressControl ctrlAddress = e.Item.FindControl("ctrlAddress") as AddressControl;

            if (ctrlAddress != null)
            {
                ctrlAddress.CountryIDToValidateZipCode = AppLogic.GetCountryID(ctrlAddress.Country);
            }

            Page.Validate("EditAddress");

            if (AddressMode == AddressTypes.Billing && pnlCCData.Visible)
            {
                if (ctrlCreditCard.CreditCardType == AppLogic.GetString("address.cs.32", SkinID, ThisCustomer.LocaleSetting))
                {
                    pnlCCTypeErrorMsg.Visible = true;
                }
                else
                {
                    pnlCCTypeErrorMsg.Visible = false;
                }
                if (ctrlCreditCard.CardExpMonth == AppLogic.GetString("address.cs.34", SkinID, ThisCustomer.LocaleSetting))
                {
                    pnlCCExpMonthErrorMsg.Visible = true;
                }
                else
                {
                    pnlCCExpMonthErrorMsg.Visible = false;
                }
                if (ctrlCreditCard.CardExpYr == AppLogic.GetString("address.cs.35", 1, ThisCustomer.LocaleSetting))
                {
                    pnlCCExpYrErrorMsg.Visible = true;
                }
                else
                {
                    pnlCCExpYrErrorMsg.Visible = false;
                }

                CardType            Type      = CardType.Parse(ctrlCreditCard.CreditCardType);
                CreditCardValidator validator = new CreditCardValidator(ctrlCreditCard.CreditCardNumber, Type);
                bool isValid = validator.Validate();

                if (!isValid && AppLogic.AppConfigBool("ValidateCreditCardNumbers"))
                {
                    ctrlCreditCard.CreditCardNumber = string.Empty;
                    // clear the card extra code
                    AppLogic.StoreCardExtraCodeInSession(ThisCustomer, string.Empty);
                    pnlCCNumberErrorMsg.Visible = true;
                }
                else
                {
                    pnlCCNumberErrorMsg.Visible = false;
                }
            }

            bool isValidCCDropdown = !(pnlCCTypeErrorMsg.Visible || pnlCCExpMonthErrorMsg.Visible ||
                                       pnlCCExpYrErrorMsg.Visible || pnlCCNumberErrorMsg.Visible);

            if (dlAddress != null && Page.IsValid && isValidCCDropdown)
            {
                AspDotNetStorefrontCore.Address anyAddress = new AspDotNetStorefrontCore.Address();
                Echeck ctrlECheck = e.Item.FindControl("ctrlECheck") as Echeck;

                if (ctrlAddress != null)
                {
                    anyAddress.AddressID     = int.Parse((e.Item.FindControl("hfAddressID") as HiddenField).Value);
                    anyAddress.CustomerID    = ThisCustomer.CustomerID;
                    anyAddress.NickName      = ctrlAddress.NickName;
                    anyAddress.FirstName     = ctrlAddress.FirstName;
                    anyAddress.LastName      = ctrlAddress.LastName;
                    anyAddress.Phone         = ctrlAddress.PhoneNumber;
                    anyAddress.Company       = ctrlAddress.Company;
                    anyAddress.AddressType   = AddressMode;
                    anyAddress.ResidenceType = (ResidenceTypes)Enum.Parse(typeof(ResidenceTypes), ctrlAddress.ResidenceType, true);
                    anyAddress.Address1      = ctrlAddress.Address1;
                    anyAddress.Address2      = ctrlAddress.Address2;
                    anyAddress.City          = ctrlAddress.City;
                    anyAddress.Suite         = ctrlAddress.Suite;
                    anyAddress.Zip           = ctrlAddress.ZipCode;
                    anyAddress.Country       = ctrlAddress.Country;
                    anyAddress.State         = ctrlAddress.State;

                    if (CustomerCCRequired && AddressMode == AddressTypes.Billing)
                    {
                        Address BillingAddress = new Address();
                        BillingAddress.LoadByCustomer(ThisCustomer.CustomerID, ThisCustomer.PrimaryBillingAddressID, AddressTypes.Billing);

                        if (ctrlCreditCard != null)
                        {
                            anyAddress.CardName = ctrlCreditCard.CreditCardName;

                            if (!ctrlCreditCard.CreditCardNumber.StartsWith("*"))
                            {
                                anyAddress.CardNumber = ctrlCreditCard.CreditCardNumber;
                            }
                            else
                            {
                                anyAddress.CardNumber = BillingAddress.CardNumber;
                            }

                            anyAddress.CardType            = ctrlCreditCard.CreditCardType;
                            anyAddress.CardExpirationMonth = ctrlCreditCard.CardExpMonth;
                            anyAddress.CardExpirationYear  = ctrlCreditCard.CardExpYr;

                            if (AppLogic.AppConfigBool("ShowCardStartDateFields"))
                            {
                                string cardStartDate = "";
                                if (ctrlCreditCard.CardExpMonth != AppLogic.GetString("address.cs.34", SkinID, ThisCustomer.LocaleSetting))
                                {
                                    cardStartDate = ctrlCreditCard.CardStartMonth;
                                }
                                if (ctrlCreditCard.CardExpYr != AppLogic.GetString("address.cs.35", SkinID, ThisCustomer.LocaleSetting))
                                {
                                    cardStartDate += ctrlCreditCard.CardStartYear;
                                }
                                anyAddress.CardStartDate = cardStartDate;
                            }
                            if (AppLogic.AppConfigBool("CardExtraCodeIsOptional"))
                            {
                                anyAddress.CardIssueNumber = ctrlCreditCard.CreditCardIssueNumber;
                            }
                        }

                        if (ShowEcheck && ctrlECheck != null)
                        {
                            anyAddress.ECheckBankAccountName = ctrlECheck.ECheckBankAccountName;
                            anyAddress.ECheckBankName        = ctrlECheck.ECheckBankName;

                            if (!ctrlECheck.ECheckBankABACode.StartsWith("*"))
                            {
                                anyAddress.ECheckBankABACode = ctrlECheck.ECheckBankABACode;
                            }
                            else
                            {
                                anyAddress.ECheckBankABACode = BillingAddress.ECheckBankABACode;
                            }

                            if (!ctrlECheck.ECheckBankAccountNumber.StartsWith("*"))
                            {
                                anyAddress.ECheckBankAccountNumber = ctrlECheck.ECheckBankAccountNumber;
                            }
                            else
                            {
                                anyAddress.ECheckBankAccountNumber = BillingAddress.ECheckBankAccountNumber;
                            }

                            anyAddress.ECheckBankAccountType = ctrlECheck.ECheckBankAccountType;
                        }

                        if (pnlCCData.Visible)
                        {
                            anyAddress.PaymentMethodLastUsed = AppLogic.ro_PMCreditCard;
                        }
                        else if (pnlECData.Visible)
                        {
                            anyAddress.PaymentMethodLastUsed = AppLogic.ro_PMECheck;
                        }
                        else
                        {
                            anyAddress.PaymentMethodLastUsed = BillingAddress.PaymentMethodLastUsed;
                        }
                    }

                    anyAddress.UpdateDB();

                    if (AppLogic.AppConfig("VerifyAddressesProvider").Length > 0)
                    {
                        AspDotNetStorefrontCore.Address standardizedAddress = new AspDotNetStorefrontCore.Address();
                        string validateResult = AddressValidation.RunValidate(anyAddress, out standardizedAddress);

                        if (validateResult != AppLogic.ro_OK)
                        {
                            var err = new CustomValidator();
                            err.ValidationGroup = "EditAddress";
                            err.IsValid         = false;
                            err.ErrorMessage    = "address.validation.errormsg".StringResource() + validateResult;
                            Page.Validators.Add(err);
                        }
                        else
                        {
                            anyAddress = standardizedAddress;
                            anyAddress.UpdateDB();
                        }
                    }

                    dlAddress.EditItemIndex = -1;
                    LoadData();
                }
            }
        }
Exemplo n.º 54
0
 public EnchantmentCard(string name, ClassType cardType, CardRarity rarity, string text, int cost, CardType type)
     : base(name, cardType, rarity, text, cost, type)
 {
 }
Exemplo n.º 55
0
        /// <summary>Creates new card registration object.</summary>
        /// <param name="cardType">Card type.</param>
        /// <returns>CardRegistration instance returned from API.</returns>
        protected async Task <CardRegistrationDTO> GetNewJohnsCardRegistration(CardType cardType = CardType.CB_VISA_MASTERCARD)
        {
            BaseTest._johnsCardRegistration = null;

            return(await GetJohnsCardRegistration(cardType));
        }
Exemplo n.º 56
0
    // Update is called once per frame
    void Update()
    {
        reaction_time_counter += Time.deltaTime;
        if (reaction_time_counter > reaction_time)
        {
            // do stuff

            // select random on hand
            if (card_to_play < 0)
            {
                card_to_play = Random.Range(0, hand_size);
            }
            CardType card_type = hand_types[card_to_play];
            if (card_type == CardType.None)
            {
                // get first playable card
                for (int i = 0; i < hand_size; ++i)
                {
                    if (hand_types[i] != CardType.None)
                    {
                        card_type    = hand_types[i];
                        card_to_play = i;
                        break;
                    }
                }
                // switch AI off if no cards left
                if (card_type == CardType.None)
                {
                    enabled = false;
                    return;
                }
            }

            // confirm spawn (a frame later to ensure initialization)
            if (deck.HasSelected())
            {
                // confirm type
                deck.PlaySelected();

                // consume resources
                m_resources.ConsumeResources(deck.cm.cards[(int)card_type].cost);

                // draw new card
                hand_types[card_to_play] = deck.DrawCard();
                card_to_play             = -1;
                reaction_time_counter    = 0.0f;
                return;
            }
            Vector2Int cost = deck.cm.cards[(int)card_type].cost;
            if (cost.x < m_resources.HR_curr && cost.y < m_resources.MR_curr)
            {
                deck.SelectType(card_type);
                // randomize position
                int        randX = Random.Range(0, battlefield.grid_size.x);
                int        randY = Random.Range(0, battlefield.grid_size.y);
                Vector2Int coord = new Vector2Int(randX, randY);
                battlefield.SnapToCaptured(ref coord, deck.team); // TeamType.Opponent);
                deck.selected_transform.position = battlefield.GetCellPos(coord);
                //rotate towards down
                deck.selected_transform.eulerAngles = new Vector3(0, 0, 180);
                //deck.selected_transform.Rotate(new Vector3(0, 0, 180));
                //deck.selected_transform.up = Vector2.down;
                //deck.selected_transform.forward = Vector3.back;
                //scale to cell size
                deck.selected_transform.localScale = new Vector3(battlefield.cell_size, battlefield.cell_size, battlefield.cell_size);
            }
        }
    }
Exemplo n.º 57
0
 public SelectableProductionCard(string id, string name, CardType type, int epoch,
                                 Resource.CurrencyItem[] costInfo, string requirementBuildCardId, SelectableProductionEffect currentEffect) :
     base(id, name, type, epoch, costInfo, requirementBuildCardId, currentEffect)
 {
 }
Exemplo n.º 58
0
        public int DeleteRow(CardType CardType)
        {
            DbTransaction Tran = null;

            return(DeleteRow(Tran, CardType));
        }
Exemplo n.º 59
0
 public Card(string card, CardType type, int _power)
 {
     this.value    = card;
     this.cardType = type;
     power         = _power;
 }
Exemplo n.º 60
0
 Card(string newName, string newNumber, DateTime newMMYY, string newCVV, string newIssuebank, CardType newType)
 {
     name      = newName;
     Number    = newNumber;
     MMYY      = newMMYY;
     CVV       = newCVV;
     IssueBank = newIssuebank;
     Type      = newType;
     Balance   = 0;
 }