// void GetSingleCard(){ // // int[] cardnumber = new int[]{1,2,3,4,5,6,7,8,9,10,11,12,13}; // int indexCount = 0; // List<AI_SingleCards> ai_SingleCards = new List<AI_SingleCards>(); // // for(int a = 0; a < cardnumber.Length; a++){ // // int cardNumber = cardnumber[a]; // // for(int i = 0; i < packInitiator.cardsPositionPoints.Count; i++){ // // if(packInitiator.cardsPositionPoints[i].cards.number == cardNumber){ // int n = IsNumberPresentInai_CardTracker(ai_SingleCards,cardNumber); // if(n == -1){ // AI_SingleCards ai_SingleCardsTemp = new AI_SingleCards(); // ai_SingleCardsTemp.cardName = packInitiator.cardsPositionPoints[i].cards.cardName; // ai_SingleCardsTemp.cardNumber = cardNumber; // ai_SingleCardsTemp.numberOfTimes+=1; // ai_SingleCardsTemp.packInitiatorIndex = i; // ai_SingleCards.Add(ai_SingleCardsTemp); // // } // else{ // ai_SingleCards[n].numberOfTimes+=1; // } // // indexCount++; // } // // } // } // // // List<AI_SingleCards> ai_SingleCardsWithMinimumNumberOfTimes = new List<AI_SingleCards>(); // // for(int i = 1; i < ai_SingleCards.Count; i++){ // if(ai_SingleCards[i].numberOfTimes <= 1){ // ai_SingleCardsWithMinimumNumberOfTimes.Add(ai_SingleCards[i]); // } // } // // if(ai_SingleCardsWithMinimumNumberOfTimes.Count >=1 ){ // packInitiator.cardsPositionPoints[ai_SingleCardsWithMinimumNumberOfTimes[0].packInitiatorIndex].cards.renderer.enabled = true; // packInitiator.cardsPositionPoints[ai_SingleCardsWithMinimumNumberOfTimes[0].packInitiatorIndex].cards.cardType = CardType.deck; // packInitiator.cardsPositionPoints[ai_SingleCardsWithMinimumNumberOfTimes[0].packInitiatorIndex].cards.StartAnimation(tempCardHolder); // // } // else{ // // int highestOrderCardIndex = 0; // for(int i = 1; i < packInitiator.cardsPositionPoints.Count; i++){ // if(packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.number < packInitiator.cardsPositionPoints[i].cards.number) // highestOrderCardIndex = i; // } // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.renderer.enabled = true; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.cardType = CardType.deck; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.StartAnimation(tempCardHolder); // // } // // // } void GetSingleCard() { int[] cardnumber = new int[]{1,2,3,4,5,6,7,8,9,10,11,12,13}; int indexCount = 0; List<AI_SingleCards> ai_SingleCards = new List<AI_SingleCards>(); for(int a = 0; a < cardnumber.Length; a++){ int cardNumber = cardnumber[a]; for(int i = 0; i < packInitiator.cardsPositionPointsList.Count; i++){ if(packInitiator.cardsPositionPointsList[i].cards.number == cardNumber){ int n = IsNumberPresentInai_CardTracker(ai_SingleCards,cardNumber); if(n == -1){ AI_SingleCards ai_SingleCardsTemp = new AI_SingleCards(); ai_SingleCardsTemp.cardName = packInitiator.cardsPositionPointsList[i].cards.cardName; ai_SingleCardsTemp.cardNumber = cardNumber; ai_SingleCardsTemp.numberOfTimes+=1; ai_SingleCardsTemp.packInitiatorIndex = i; ai_SingleCards.Add(ai_SingleCardsTemp); } else{ ai_SingleCards[n].numberOfTimes+=1; } indexCount++; } } } bool singleCardFound = false; for(int i = 0; i < ai_SingleCards.Count; i++){ if(ai_SingleCards[i].numberOfTimes <= 1){ packInitiator.cardsPositionPointsList[ai_SingleCards[i].packInitiatorIndex].cards.renderer.enabled = true; packInitiator.cardsPositionPointsList[ai_SingleCards[i].packInitiatorIndex].cards.cardType = CardType.deck; packInitiator.cardsPositionPointsList[ai_SingleCards[i].packInitiatorIndex].cards.StartAnimation(tempCardHolder); singleCardFound = true; break; } } if(!singleCardFound){ print("singleCardFound "+singleCardFound.ToString()); } // else{ // // int highestOrderCardIndex = 0; // for(int i = 1; i < packInitiator.cardsPositionPoints.Count; i++){ // if(packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.number < packInitiator.cardsPositionPoints[i].cards.number) // highestOrderCardIndex = i; // } // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.renderer.enabled = true; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.cardType = CardType.deck; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.StartAnimation(tempCardHolder); // // } }
// void GetSingleCard(){ // // int[] cardnumber = new int[]{1,2,3,4,5,6,7,8,9,10,11,12,13}; // int indexCount = 0; // List<AI_SingleCards> ai_SingleCards = new List<AI_SingleCards>(); // // for(int a = 0; a < cardnumber.Length; a++){ // // int cardNumber = cardnumber[a]; // // for(int i = 0; i < packInitiator.cardsPositionPoints.Count; i++){ // // if(packInitiator.cardsPositionPoints[i].cards.number == cardNumber){ // int n = IsNumberPresentInai_CardTracker(ai_SingleCards,cardNumber); // if(n == -1){ // AI_SingleCards ai_SingleCardsTemp = new AI_SingleCards(); // ai_SingleCardsTemp.cardName = packInitiator.cardsPositionPoints[i].cards.cardName; // ai_SingleCardsTemp.cardNumber = cardNumber; // ai_SingleCardsTemp.numberOfTimes+=1; // ai_SingleCardsTemp.packInitiatorIndex = i; // ai_SingleCards.Add(ai_SingleCardsTemp); // // } // else{ // ai_SingleCards[n].numberOfTimes+=1; // } // // indexCount++; // } // // } // } // // // List<AI_SingleCards> ai_SingleCardsWithMinimumNumberOfTimes = new List<AI_SingleCards>(); // // for(int i = 1; i < ai_SingleCards.Count; i++){ // if(ai_SingleCards[i].numberOfTimes <= 1){ // ai_SingleCardsWithMinimumNumberOfTimes.Add(ai_SingleCards[i]); // } // } // // if(ai_SingleCardsWithMinimumNumberOfTimes.Count >=1 ){ // packInitiator.cardsPositionPoints[ai_SingleCardsWithMinimumNumberOfTimes[0].packInitiatorIndex].cards.renderer.enabled = true; // packInitiator.cardsPositionPoints[ai_SingleCardsWithMinimumNumberOfTimes[0].packInitiatorIndex].cards.cardType = CardType.deck; // packInitiator.cardsPositionPoints[ai_SingleCardsWithMinimumNumberOfTimes[0].packInitiatorIndex].cards.StartAnimation(tempCardHolder); // // } // else{ // // int highestOrderCardIndex = 0; // for(int i = 1; i < packInitiator.cardsPositionPoints.Count; i++){ // if(packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.number < packInitiator.cardsPositionPoints[i].cards.number) // highestOrderCardIndex = i; // } // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.renderer.enabled = true; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.cardType = CardType.deck; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.StartAnimation(tempCardHolder); // // } // // // } void GetSingleCard() { int[] cardnumber = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; int indexCount = 0; List <AI_SingleCards> ai_SingleCards = new List <AI_SingleCards>(); for (int a = 0; a < cardnumber.Length; a++) { int cardNumber = cardnumber[a]; for (int i = 0; i < packInitiator.cardsPositionPointsList.Count; i++) { if (packInitiator.cardsPositionPointsList[i].cards.number == cardNumber) { int n = IsNumberPresentInai_CardTracker(ai_SingleCards, cardNumber); if (n == -1) { AI_SingleCards ai_SingleCardsTemp = new AI_SingleCards(); ai_SingleCardsTemp.cardName = packInitiator.cardsPositionPointsList[i].cards.cardName; ai_SingleCardsTemp.cardNumber = cardNumber; ai_SingleCardsTemp.numberOfTimes += 1; ai_SingleCardsTemp.packInitiatorIndex = i; ai_SingleCards.Add(ai_SingleCardsTemp); } else { ai_SingleCards[n].numberOfTimes += 1; } indexCount++; } } } bool singleCardFound = false; for (int i = 0; i < ai_SingleCards.Count; i++) { if (ai_SingleCards[i].numberOfTimes <= 1) { packInitiator.cardsPositionPointsList[ai_SingleCards[i].packInitiatorIndex].cards.renderer.enabled = true; packInitiator.cardsPositionPointsList[ai_SingleCards[i].packInitiatorIndex].cards.cardType = CardType.deck; packInitiator.cardsPositionPointsList[ai_SingleCards[i].packInitiatorIndex].cards.StartAnimation(tempCardHolder); singleCardFound = true; break; } } if (!singleCardFound) { print("singleCardFound " + singleCardFound.ToString()); } // else{ // // int highestOrderCardIndex = 0; // for(int i = 1; i < packInitiator.cardsPositionPoints.Count; i++){ // if(packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.number < packInitiator.cardsPositionPoints[i].cards.number) // highestOrderCardIndex = i; // } // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.renderer.enabled = true; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.cardType = CardType.deck; // packInitiator.cardsPositionPoints[highestOrderCardIndex].cards.StartAnimation(tempCardHolder); // // } }