Пример #1
0
 public override void Deal()
 {
     if (round == 0) {
         foreach (IChinesePokerPlayer player in players) {
             int pos = player.getPosition ();
             List<Hand> hands = player.layoutFirstHand (myDeck.getCards (5), new ChinesePokerTable (m_opponents));
             Opponent next = new Opponent ();
             next.position = pos;
             int ind = pos - 1;
             next.hands = hands;
             next.name = player.getName();
             Console.WriteLine ("Player opponent at " + pos);
             Console.WriteLine ("Player opponent at " + m_opponents [ind]);
             m_opponents [ind] = next;
         }
     } else {
         foreach (IPlayer player in players) {
             ChinesePokerTable tab = new ChinesePokerTable (m_opponents);
     //					ChineseMove player_move = (ChineseMove)
             player.takeAction (new List<Card> (){ myDeck.getCard() }, (Table)tab);
     //					int pos = player.getPosition ();
     //					int ind = pos-1;
     //					m_opponents [ind].hands [player_move.rowNumber].cards.Add (player_move.myCard);
         }
     }
     if (myDeck.getStackSize() < players.Count) {
         GameOver = true;
     }
     round++;
 }
Пример #2
0
 public List<Hand> layoutFirstHand(List<Card> cards, ChinesePokerTable currentState)
 {
     foreach (Card next in cards) {
         this.takeAction (new List<Card> (){next}, currentState);
     }
     return hands;
 }