private void DrawButton_Click(object sender, EventArgs e)
        {
            var args = new BoardReportArgs(true, true, true);

            this.DrawEvent(sender, args);
            this.UpdateUI(args);
            this.DrawButton.Enabled = false;
        }
        private void button5_Click(object sender, EventArgs e)
        {
            this.TogglePlayerUI();
            var args = new BoardReportArgs(false, false, true);

            this.End(sender, args);
            this.UpdateUI(args);
            this.TogglePlayerUI();
        }
 private void SelectEnemy(object sender, EventArgs e)
 {
     if (this.battleParams.battleSelectEnemy)
     {
         this.battleParams.IdDefender        = (sender as PictureBox).Image.Tag.ToString();
         this.battleParams.battleSelectEnemy = false;
         this.SetClicking(this.aiMonsters, false);
         var args = new BoardReportArgs(true, true, true, bArgs: new BattleArgs(this.battleParams.IdAttacker, this.battleParams.IdDefender));
         this.Battle(sender, args);
         this.UpdateUI(args);
         this.battleParams.IdAttacker = this.battleParams.IdDefender = null;
         if (this.pFieldC.Where(x => x.Image != null).Any())
         {
             this.BattleButton_Click(this.BattleButton, e);
         }
     }
 }
        private void RaisePlay(object sender, MouseEventArgs e)
        {
            // TODO: add a message box that ask for monster position or something like that


            bool left = e.Button == MouseButtons.Left;

            var box = sender as PictureBox;

            if (box.Image == null)
            {
                return;
            }
            var args = new BoardReportArgs(this.EndTurnButton.Enabled, this.EndTurnButton.Enabled, left, box.Image.Tag.ToString());

            this.PlayCardEvent(sender, args);
            this.UpdateUI(args);
            this.pHandC[args.Player.Hand.Count].Image = null;
            this.SetClicking(this.pHandC, false);
        }
 private void UpdateUI(BoardReportArgs args)
 {
     for (int i = 0; i < 6; i++)
     {
         if (args.PlayerMonsters.Count > i)
         {
             UpdateBox(this.pFieldC[i], args.PlayerMonsters[i], args.PlayerMonsters[i].FaceUp);
         }
         else if (i < this.pFieldC.Length)
         {
             this.pFieldC[i].Image = null;
         }
         if (args.PlayerEffects.Count > i)
         {
             UpdateBox(this.pSpellC[i], args.PlayerEffects[i], args.PlayerEffects[i].FaceUp);
         }
         if (args.AIMonsters.Count > i)
         {
             UpdateBox(this.aiMonsters[i], args.AIMonsters[i], args.AIMonsters[i].FaceUp);
         }
         else if (i < this.pFieldC.Length)
         {
             this.aiMonsters[i].Image = null;
         }
         if (args.AIEffects.Count > i)
         {
             UpdateBox(this.aiSpells[i], args.AIEffects[i], args.AIEffects[i].FaceUp);
         }
         if (args.Player.Hand.Count > i)
         {
             UpdateBox(this.pHandC[i], args.Player.Hand[i]);
         }
     }
     this.aiLife.Text            = args.AI.LifePoints.ToString();
     this.playerLife.Text        = args.Player.LifePoints.ToString();
     this.PlayerCardsInDeck.Text = args.PlayerCardsRemaining.ToString();
 }