예제 #1
0
파일: Main.cs 프로젝트: perljedi/spare_time
        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();
 }