public PlayerList(PlayerList PlayerList) { this.list.AddRange(PlayerList.list); }
public void AddRange(PlayerList players) { list.AddRange(players); }
/// <summary> /// Get Call Percent based on analysis of cards of all Players /// </summary> /// <param name="playerLists">List of all Players</param> /// <param name="aIPlayer">Current AI Player</param> /// <returns></returns> private int GetCallPercent(PlayerList playerLists, AIPlayer currentPlayer) { Debug.Log("Inside Call Percent Method"); int cardCount = myDeck.CardsCount(); int size = 0; int no_Of_Players = playerLists.Count; int lastRoundScore = previousRoundScore; Card roundCard = currentRoundCard; int tempPercent = 0; int index = 0; int score = EvaluateScore(); if (cardCount <= 2) { if (score <= 4) { return(100); //Call percent =100 } else if (score >= 10) { return(0); //Call percent =0 } } foreach (Player player in playerLists) { if (player == currentPlayer) { continue; } int otherPlayerCard = player.GetDeck().CardsCount(); int otherPlayerLastRoundScore = player.GetPreviousRoundScore(); if (cardCount <= otherPlayerCard) //if current player card is less than other player card { // To Do Seprate previous Round original score and ScoreBoard Score if ((lastRoundScore + roundCard.GetRankValue()) <= otherPlayerLastRoundScore) // if last round won by current player { tempPercent += 100; } else if ((lastRoundScore + roundCard.GetRankValue()) <= (otherPlayerLastRoundScore + 2)) { tempPercent += new Random().Next(50, 100); } else { tempPercent += new Random().Next(101); } } else { if ((float)(score / cardCount) <= 2.5f) { tempPercent += new Random().Next(50, 100); } else { tempPercent += new Random().Next(0, 90); } } } callPercent = tempPercent / (no_Of_Players - 1); //excluding current player return(callPercent); }