public void Bacenekarte(List <Karta> karte, Boja boja, int BrojKarataProtivnika) { if (karte != null && karte.Count > 0) { talon = karte.Last(); remainingCards.remove(karte); } novaBoja = boja; brojKarataEnemy = BrojKarataProtivnika; BestMove = new Move(); kupio = false; if (karte != null && karte.Count > 0) { kupioKaznene = false; } else { kupioKaznene = true; } }
public Board(Board board, IMove move) : this() { counter = new CardCounter(board.counter); talon = move; enemyHand = board.enemyHand; this.hand = new List <Karta>(board.hand); if (board.yourTurn) { foreach (Karta k in move.Karte) { hand.Remove(k); } } else { foreach (Karta k in move.Karte) { counter.remove(k); } enemyHand--; } if (move.Tip == TipPoteza.BacaKartu && move.Karte.Last().Broj == "7") { penalty = true; } else { penalty = false; } if (move.Tip == TipPoteza.BacaKartu && (move.Karte.Last().Broj == "A" || move.Karte.Last().Broj == "8")) { yourTurn = board.yourTurn; } else { yourTurn = !board.yourTurn; } }
public Board(IMove lastMove, bool turn, List <Karta> yourHand, int enemy, CardCounter used, bool kaznene) : this() { lock (Gilgamesh._locker) { counter = new CardCounter(used); talon = lastMove; hand = new List <Karta>(yourHand); /* * if (yourHand != null && yourHand.Count > 0) * { * hand.AddRange(yourHand); * }*/ enemyHand = enemy; counter.remove(lastMove.Karte); yourTurn = turn; if (lastMove.Tip == TipPoteza.BacaKartu && lastMove.Karte.Count > 0 && (lastMove.Karte.Last().Broj == "7" || (lastMove.Karte.Last().Broj == "2" && lastMove.Karte.Last().Boja == Boja.Tref)) && !kaznene) { penalty = true; } } }