コード例 #1
0
ファイル: MainForm.cs プロジェクト: Aleksandar7kr/ETU
        public MainForm()
        {
            InitializeComponent();
            t = new Table(6, Suits.Diamonds);
            while (t.CountAttackCards < 6)
            {
                t.PutToAttack(d.GiveNextCard());
            }

            _userView = new PlayerView(game.User);
            _cpuView = new PlayerView(game.Cpu);
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: Aleksandar7kr/ETU
 public UserTableManager(Player u, Player c, Deck d, Suits s, Table t, int state)
 {
     _u = u; _c = c; _d = d; _s = s; _t = t;
     end = false;
     if (state == 1)
     {
         while (_u.CardCount < 6 && !_d.isEmpty())
         {
             _u.CardToHand(_d.GiveNextCard());
         }
         while (_c.CardCount < 6 && !_d.isEmpty())
         {
             _c.CardToHand(_d.GiveNextCard());
         }
         _t.PutToAttack(_c.Hand[0]);
         _c.Hand.RemoveAt(0);
     }
     else
     {
         while (_c.CardCount < 6 && !_d.isEmpty())
         {
             _c.CardToHand(_d.GiveNextCard());
         }
         while (_c.CardCount < 6 && !_d.isEmpty())
         {
             _c.CardToHand(_d.GiveNextCard());
         }
     }
 }