Пример #1
0
        public Move takeAction(List<Card> cards, Table currentState)
        {
            Console.WriteLine(myName + " is adding card to "+nextHand);
            var nextMove = new ChineseMove();
            nextMove.myCard = cards[0];
            nextMove.rowNumber = nextHand;
            hands[nextHand].cards.Add (cards[0]);
            if(hands[nextHand].cards.Count == 5){
                Console.WriteLine("Hand has 5 cards");
                foreach(Card cd in hands[nextHand].cards){
                    Console.Write(cd.suit+" "+cd.value+", ");
                }
                Console.WriteLine(" and is full");
                nextHand++;
            }

            return nextMove;
        }
Пример #2
0
 private void form_NewGameInit(object sender, EventArgs e)
 {
     GameInitArgs args = (GameInitArgs)e;
     if (table == null)
         table = new Table(args.NumberOfPlayers, args.PlayerName, args.InitStack, this);
     else
     {
         table.mainplayer.Name = args.PlayerName;
         render.mainform.Unsubscribe(this);
         render.mainform.ReInitialize();
         render.mainform.Subscribe(this);
     }
     Subscribe(this);
     OnGameBegin(new EventArgs());
     table.NewHand();
 }