public List <CardData> FiltterCardsData(List <CardData> cDat, bool showCardPlayerDontOwn = false, Dictionary <string, int> quantityOfCardsUserHaveFromBDOnline = null, CardRarity rarity = CardRarity.NONE, bool isChainable = false, bool isDarkCard = false, int darkPoints = -1, CARDTYPE cardType = CARDTYPE.NONE, ACTIVATIONTYPE activationType = ACTIVATIONTYPE.NONE, string keyword = "") { if (quantityOfCardsUserHaveFromBDOnline != null && showCardPlayerDontOwn == false) { cDat = FiltterCardDataWithCardsUserDontOwn(quantityOfCardsUserHaveFromBDOnline, cDat); } cDat = FiltterCardDataByRarity(rarity, cDat); cDat = FiltterCardDataByType(cardType, cDat); cDat = FiltterCardDataByActivationType(activationType, cDat); if (isChainable) { cDat = FiltterCardDataOnlyChainable(cDat); } if (isDarkCard || darkPoints > -1) { cDat = FiltterCardDataOnlyDark(cDat); } if (darkPoints > -1) { cDat = FiltterCardDataByDarkPointAmount(cDat, darkPoints); } cDat = FiltterCardDataByKeyword(cDat, keyword); var orderList = cDat.OrderBy(c => c.ID); List <CardData> cda = orderList.ToList(); return(cda); }
public static CARDTYPE GetCardTypeFromInt(int pIDType) { //var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length; //YourEnum foo = (YourEnum)yourInt; int typeTotalCount = Enum.GetNames(typeof(CARDTYPE)).Length; if (pIDType - 1 >= typeTotalCount || pIDType - 1 < 0) { return(CARDTYPE.NONE); } CARDTYPE type = (CARDTYPE)pIDType - 1; return(type); }
public List <CardData> FiltterCardDataByType(CARDTYPE type, List <CardData> cards) { if (type == CARDTYPE.NONE) { return(cards); } List <CardData> returnC = new List <CardData>(); for (int i = 0; i < cards.Count; i++) { if (cards[i].CardType == type) { returnC.Add(cards[i]); } } return(returnC); }
public void SetCardTypeInteractuableImage(CardCollectionSearchManager cardColelctionSearchManager, CARDTYPE cardType, string text) { this.cardColelctionSearchManager = cardColelctionSearchManager; this.cardType = cardType; this.text.text = text; }
public Card(CARDTYPE newType) { this.type = newType; }
public ConcreteCardFactory(CARDTYPE cardtype, int annualCharge) { _annualCharge = annualCharge; _cardtype = cardtype; }
public bool compareType(int[] oldCardArray, int[] newCardArray) { if (oldCardArray == null || oldCardArray.Length == 0) { return(false); } if (newCardArray == null || newCardArray.Length == 0) { return(false); } CARDTYPE type1 = getType(oldCardArray); CARDTYPE type2 = getType(newCardArray); MyDebug.Log("compareType+++++++++++++++=====" + type1 + "/////" + type2); if (type1 == type2) { int[] oldCard = new int[oldCardArray.Length]; for (int i = 0; i < oldCardArray.Length; i++) { if (oldCardArray[i] < 52) { oldCard[i] = oldCardArray[i] % 13; } else { oldCard[i] = oldCardArray[i]; // 大小王判断 } } // 从小到大排序 Array.Sort(oldCard); int[] newCard = new int[newCardArray.Length]; for (int i = 0; i < newCardArray.Length; i++) { if (newCardArray[i] < 52) { newCard[i] = newCardArray[i] % 13; } else { newCard[i] = newCardArray[i]; } } // 从小到大排序 Array.Sort(newCard); if (type1 == CARDTYPE.c1) //单牌 { if (oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c2 && oldCard[1] < 52 && oldCard[0] != 0 && oldCard[0] != 12) // 对子 { if (oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c112233) //连对 { if (newCard.Length == oldCard.Length && oldCard[0] < newCard[0]) { return(true); } } // else if(type1 == CARDTYPE.c311) {//三带2 // List<int>[] a = getCount(oldCard); // List<int>[] b = getCount(newCard); // if( (int)a[2][0] < (int)b[2][0]) { // return true; // } //} else if (type1 == CARDTYPE.c1112223456) //飞机带翅膀 { List <int>[] a = getCount(oldCard); List <int>[] b = getCount(newCard); if (oldCard.Length == newCard.Length && (int)a[2][0] < (int)b[2][0]) { return(true); } } else if (type1 == CARDTYPE.c12345) //顺子 { if (oldCard.Length == newCard.Length && oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c4) //炸弹 { if (oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c111122) //四带二lan { if (oldCard[0] < newCard[0]) { return(true); } } } else { if (type2 == CARDTYPE.c4) //后面的是炸弹 { return(true); } } return(false); }
public bool isCanChi(int[] chuCard_old, int[] myCardArray_old) { CARDTYPE type1 = getType(chuCard_old); int[] chuCard = new int[chuCard_old.Length]; for (int i = 0; i < chuCard_old.Length; i++) { chuCard[i] = chuCard_old[i] % 13; } // 从小到大排序 Array.Sort(chuCard); int count = 0; for (int i = 0; i < myCardArray_old.Length; i++) { if (myCardArray_old[i] > 0) { count++; } } int[] myCardArray = new int[count]; count = 0; for (int i = 0; i < myCardArray_old.Length; i++) { if (myCardArray_old[i] > 0) { myCardArray[count] = i % 13; count++; } } // 从小到大排序 Array.Sort(myCardArray); List <int>[] a = getCount(chuCard); List <int>[] b = getCount(myCardArray); int length = myCardArray.Length; if (type1 == CARDTYPE.c1) //单牌 { if (b[3].Count > 0) { return(true); } if (chuCard[0] < myCardArray[length - 1]) { return(true); } } else if (type1 == CARDTYPE.c2) // 对子 { if (b[3].Count > 0) { return(true); } if (b[2].Count > 0 && chuCard[0] < (int)b[2][b[2].Count - 1]) { return(true); } if (b[1].Count > 0 && chuCard[0] < (int)b[1][b[1].Count - 1]) { return(true); } } else if (type1 == CARDTYPE.c112233) //连对 { if (b[3].Count > 0) { return(true); } //首先得手牌超过上家出的张数 if (length >= chuCard.Length) { //循环遍历玩家手牌 是否有大于出牌的 for (int i = chuCard[0] + 1; i < 13; i++) { int findCount = 0; for (int j = 0; j < chuCard.Length / 2; j++) { //遍历2张的。 for (int k = 0; k < b[1].Count; k++) { if ((int)b[1][k] != 12 && (int)b[1][k] == i + j) { findCount++; break; } } //遍历3张的。 for (int k = 0; k < b[2].Count; k++) { if ((int)b[2][k] != 12 && (int)b[2][k] == i + j) { findCount++; break; } } } if (findCount >= chuCard.Length / 2) { return(true); } } } } // else if(type1 == CARDTYPE.c311) {//三带2 // if(b[3].Count>0) // return true; // //首先得手牌超过上家出的张数 // if(length >=chuCard.Length && b[2].Count>0 && (int)a[2][0] < (int)b[2][b[2].Count-1]) { // return true; // } //} else if (type1 == CARDTYPE.c1112223456) //飞机带翅膀 { if (b[3].Count > 0) { return(true); } //首先得手牌超过上家出的张数 if (length >= chuCard.Length) { //循环遍历玩家手牌 是否有大于出牌的 for (int i = (int)a[2][0] + 1; i < 13; i++) { int findCount = 0; for (int j = 0; j < chuCard.Length / 5; j++) { //遍历3张的。 for (int k = 0; k < b[2].Count; k++) { if ((int)b[2][k] != 12 && (int)b[2][k] == i + j) { findCount++; break; } } //遍历4张的。 for (int k = 0; k < b[3].Count; k++) { if ((int)b[3][k] != 12 && (int)b[3][k] == i + j) { findCount++; break; } } } if (findCount >= chuCard.Length / 5) { return(true); } } } } else if (type1 == CARDTYPE.c12345) //顺子 { if (b[3].Count > 0) { return(true); } //首先得手牌超过上家出的张数 if (length >= chuCard.Length) { //循环遍历玩家手牌 是否有大于出牌的 for (int i = chuCard[0] + 1; i < 13; i++) { int findCount = 0; for (int j = 0; j < chuCard.Length; j++) { for (int k = 0; k < length; k++) { if (myCardArray[k] != 12 && myCardArray[k] == i + j) { findCount++; break; } } } if (findCount >= chuCard.Length) { return(true); } } } } else if (type1 == CARDTYPE.c4) //炸弹 { if (b[3].Count > 0 && chuCard[0] < (int)b[3][b[3].Count - 1]) { return(true); } } return(false); }
public void OnFiltterByTypeButtonPress(List <CardTypeInteractuableImage> cardTypeInteractuableImage, CARDTYPE cardType) { if (vsFiltters.cType == cardType) { return; } foreach (CardTypeInteractuableImage i in cardTypeInteractuableImage) { if (i.cardType != cardType) { i.backgroundImage.color = i.UnactiveColor; i.IsPressed = false; } } vsFiltters.cType = cardType; Refresh(); }
public void OnFiltterByTypeButtonPress(CARDTYPE cardType) { visualFiltterUIHandler.OnFiltterByTypeButtonPress(cardTypeInteractuableImage, cardType); }
public Card(string CityName, CARDTYPE type) { this.CityName = CityName; this.CardType = type; }
public Card(string CityName, CARDTYPE type, COLOR color) { this.CityName = CityName; this.CardType = type; this.CityColor = color; }
public bool compareType(int[] oldCardArray, int[] newCardArray) { if (oldCardArray == null || oldCardArray.Length == 0) { return(false); } if (newCardArray == null || newCardArray.Length == 0) { return(false); } CARDTYPE type1 = getType(oldCardArray); CARDTYPE type2 = getType(newCardArray); if (type1 == type2) { int[] oldCard = new int[oldCardArray.Length]; for (int i = 0; i < oldCardArray.Length; i++) { oldCard[i] = oldCardArray[i] % 13; } // 从小到大排序 Array.Sort(oldCard); int[] newCard = new int[newCardArray.Length]; for (int i = 0; i < newCardArray.Length; i++) { newCard[i] = newCardArray[i] % 13; } // 从小到大排序 Array.Sort(newCard); if (type1 == CARDTYPE.c1) //单牌 { if (oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c2) // 对子 { if (oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c112233) //连对 { if (newCard.Length == oldCard.Length && oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c311) //三带2 { List <int>[] a = getCount(oldCard); List <int>[] b = getCount(newCard); if ((int)a[2][0] < (int)b[2][0]) { return(true); } } else if (type1 == CARDTYPE.c1112223456) //飞机带翅膀 { List <int>[] a = getCount(oldCard); List <int>[] b = getCount(newCard); if (oldCard.Length == newCard.Length && (int)a[2][0] < (int)b[2][0]) { return(true); } } else if (type1 == CARDTYPE.c12345) //顺子 { if (oldCard.Length == newCard.Length && oldCard[0] < newCard[0]) { return(true); } } else if (type1 == CARDTYPE.c4) //炸弹 { if (oldCard[0] < newCard[0]) { return(true); } } } else { if (type2 == CARDTYPE.c4) //后面的是炸弹 { return(true); } } return(false); }