private void SendUpdatedBoardAndStats() { foreach (int player in players) { DataSender.SendUpdatedStats(player, PackStats(player, playerToPlayer[player])); } foreach (int player in players) { DataSender.SendUpdatedBoard(player, playerMapHand[player], playerMapBench[player], playerMapAttackZone[player], playerMapBench[playerToPlayer[player]], playerMapAttackZone[playerToPlayer[player]]); } }
public void Mulligan(int playerID, List <Card> cards) { phase = ClientManager.clients[player1ID].name + "'s TURN"; foreach (Card card in cards) { int index = -1; for (int x = 0; x < playerMapHand[playerID].Count; x++) { if (card.id.Equals(playerMapHand[playerID][x].id)) { index = x; break; } } if (index != -1) { playerMapHand[playerID].RemoveAt(index); } } playerMapDeck[playerID].AddRange(cards); ShuffleDeck(playerMapDeck[playerID]); DrawCards(cards.Count, playerID); DataSender.SendMulligan(playerID, playerMapHand[playerID]); DataSender.SendUpdatedBoard(playerID, playerMapHand[playerID], playerMapBench[playerID], playerMapAttackZone[playerID], playerMapBench[playerToPlayer[playerID]], playerMapAttackZone[playerToPlayer[playerID]]); if (isMulliganDone) { DrawCards(1, player1ID); DrawCards(1, player2ID); attackPlayerId = player1ID; SendUpdatedBoardAndStats(); } isMulliganDone = false ? true : true; }