コード例 #1
0
ファイル: MasterForm.cs プロジェクト: MatsJSvensson/7Wonders
        private void button1_Click(object sender, EventArgs e)
        {
            if (button1.Text == "Restart")
            {
                master.restart = true;
                this.Close();
            }
            else
            {
                this.Hide();
                if (boards[currentPlayer].IsDisposed)
                {
                    boards[currentPlayer] = new Playerboard(this, master.Players[currentPlayer]);
                    master.Players[currentPlayer].board = boards[currentPlayer];
                }

                boards[currentPlayer].phase = phase;
                if (phase < 2)
                {
                    boards[currentPlayer].showLeaderHand();
                }
                else
                {
                    boards[currentPlayer].showHand();
                }

                boards[currentPlayer].UpdateGold(); boards[currentPlayer].DisplayMessage("");
                boards[currentPlayer].Show();
            }
        }
コード例 #2
0
ファイル: MasterForm.cs プロジェクト: MatsJSvensson/7Wonders
        public MasterForm(GameMaster m)
        {
            master        = m;
            currentPlayer = 0;
            phaseCounter  = 0;
            age           = 1;
            nP            = master.nPlayers;
            lastCard      = false;
            InitializeComponent();
            boards = new Playerboard[nP];
            score  = new int[nP];

            if (master.version >= 1)
            {
                phase = 0;
            }
            else
            {
                phase = 2;
            }

            for (int i = 0; i < nP; i++)
            {
                score[i]  = 0;
                boards[i] = new Playerboard(this, master.Players[i]);
                master.Players[i].board = boards[i];
                boards[i].Hide();
            }

            label1.Text   = master.Players[currentPlayer].wonder;
            Neighbourhood = new ResultForm(this, "Neighborhood");
            Neighbourhood.Show();
        }
コード例 #3
0
 private void itemClick7(object sender, EventArgs e)
 {
     if (theCopy == null)
     {
         theCopy = new Playerboard(_MasterForm, theMaster.Players[6], true);
     }
     else if (theCopy.IsDisposed)
     {
         theCopy = new Playerboard(_MasterForm, theMaster.Players[6], true);
     }
     else if (theCopy.thisPlayer != theMaster.Players[6])
     {
         theCopy.Close();
         theCopy = new Playerboard(_MasterForm, theMaster.Players[6], true);
     }
     theCopy.Show();
 }
コード例 #4
0
ファイル: CardForm.cs プロジェクト: MatsJSvensson/7Wonders
        public CardForm(Card aCard, int mode, Playerboard board)
        {
            InitializeComponent();
            _Card             = aCard;
            theBoard          = board;
            this.Text         = _Card.name;
            this.BackColor    = getColor(_Card.color);
            richTextBox1.Text = _Card.description;
            showCost();

            if (mode == 0)
            {
                buildButton.Visible  = false;
                wonderButton.Visible = false;
                sellButton.Text      = "Pick";
            }
            if (mode == 2)
            {
                buildButton.Visible  = false;
                sellButton.Visible   = false;
                wonderButton.Visible = false;
            }
        }