public void PlayManipulationCard() { playedManipulationCard = selectedManipulationCard; isManipulationCardPlayed = true; if (playedManipulationCard.getCardName() == ManipulationCard.ManipulationCardName.KolegaWKomitecie) { //pokaż na 3 sekundy 2 pierwsze karty dostaw } }
public void PlayManipulationCard(ManipulationCard manipulationCard) { //manipulationCard.PlayCard(); for (int i = 0; i < this.manipulationCards.Count; i++) //usuwanie karty z listy { if ((int)this.manipulationCards[i].getCardName() == (int)manipulationCard.getCardName()) { this.manipulationCards.RemoveAt(i); } } for (int i = 0; i < this.avlManipulationCards.Count; i++) //usuwanie karty z dostępnej trójki { if ((int)this.avlManipulationCards[i].getCardName() == (int)manipulationCard.getCardName()) { this.avlManipulationCards.RemoveAt(i); } } }
public void SelectQueue(QueueManager queueManager) { string queue = queueManager.name; int tmpQue; if (queue == "Newsstand Queue") { tmpQue = 0; } else if (queue == "Grocery Queue") { tmpQue = 1; } else if (queue == "Electronic Queue") { tmpQue = 2; } else if (queue == "Furniture Queue") { tmpQue = 3; } else if (queue == "Clothing Queue") { tmpQue = 4; } else //if(myQueue.name == "Bazaar Queue") { tmpQue = 5; } if (isManipulationCardPlayed == true && playedManipulationCard.getCardName() == ManipulationCard.ManipulationCardName.ListaSpoleczna) { List <int[]> tmpQueueList = new List <int[]>(); foreach (int[] pawn in pawnOwners[tmpQue]) { tmpQueueList.Add(pawn); } tmpQueueList.Reverse(); pawnOwners[tmpQue].Clear(); int i = 0; foreach (GameObject field in fieldsDictionary[tmpQue]) { int[] tmpPawn = tmpQueueList[i]; if (tmpPawn[0] != 9) { MovePawn(players[tmpPawn[0]].pawns[tmpPawn[1]], field); } else { MovePawn(blackPawns[tmpPawn[1]], field); } pawnOwners[tmpQue].Add(tmpPawn); i++; } players[currentPlayer].PlayManipulationCard(playedManipulationCard); selectedManipulationCard = null; playedManipulationCard = null; EndOfTurn(); } else if (playedManipulationCard.getCardName() == ManipulationCard.ManipulationCardName.SzczesliwyTraf && isPawnSelected == true) { int tmpPawnQue = 0; int tmpPawnField = 0; for (int i = 0; i < 5; i++) { int j = 0; foreach (int[] pawn in pawnOwners[i]) { if (pawn[0] == selectedPawnPlayer.numberOfPlayer && pawn[1] == selectedPawn[1]) { tmpPawnQue = i; tmpPawnField = j; } j++; } } //dodanie pionka do innej kolejki pawnOwners[tmpQue].Insert(1, selectedPawn); for (int i = 1; i < (pawnOwners[tmpQue].Count - 1); i++) { if (pawnOwners[tmpQue][i][0] == 9) { MovePawn(blackPawns[pawnOwners[tmpQue][i][1]], fieldsDictionary[tmpQue][i]); } else { MovePawn(players[pawnOwners[tmpQue][i][0]].pawns[pawnOwners[tmpQue][i][1]], fieldsDictionary[tmpQue][i]); } } GameObject freeField = queueManager.getFreeField(); if (freeField != null) { fieldsDictionary[tmpQue].Add(freeField); if (pawnOwners[tmpQue][pawnOwners[tmpQue].Count - 1][0] == 9) { MovePawn(blackPawns[pawnOwners[tmpQue][pawnOwners[tmpQue].Count - 1][1]], fieldsDictionary[tmpQue][pawnOwners[tmpQue].Count - 1]); } else { MovePawn(players[pawnOwners[tmpQue][pawnOwners[tmpQue].Count - 1][0]].pawns[pawnOwners[tmpQue][pawnOwners[tmpQue].Count - 1][1]], fieldsDictionary[tmpQue][pawnOwners[tmpQue].Count - 1]); } } else { pawnOwners[tmpQue].RemoveAt(pawnOwners[tmpQue].Count - 1); } //usuniecie pionka pawnOwners[tmpPawnQue].RemoveAt(tmpPawnField); fieldsDictionary[tmpPawnQue].RemoveAt(fieldsDictionary[tmpPawnQue].Count - 1); for (int i = tmpPawnField; i < pawnOwners[tmpPawnQue].Count; i++) { if (pawnOwners[tmpPawnQue][i][0] == 9) { MovePawn(blackPawns[pawnOwners[tmpPawnQue][i][1]], fieldsDictionary[tmpPawnQue][i]); } else { MovePawn(players[pawnOwners[tmpPawnQue][i][0]].pawns[pawnOwners[tmpPawnQue][i][1]], fieldsDictionary[tmpPawnQue][i]); } } //koniec players[currentPlayer].PlayManipulationCard(playedManipulationCard); selectedManipulationCard = null; playedManipulationCard = null; EndOfTurn(); } }