コード例 #1
0
        private void labelClickLeft(object sender, EventArgs e)
        {
            Label theLabel = (Label)sender;
            int   filled;
            Card  aCard = new Card();

            switch (mode)
            {
            case "Olympus":
                int pl = (thePlayer.position + 1) % np;     //Left Player
                filled = theMaster.Players[pl].builtCards.Count(x => x != null);
                for (int i = 0; i < filled; i++)
                {
                    if (theMaster.Players[pl].builtCards[i].name == theLabel.Text)
                    {
                        aCard = theMaster.Players[pl].builtCards[i];
                        break;
                    }
                }
                break;

            case "Spy Card":
                goto case "Olympus";

            case "Courtesan":
                goto case "Olympus";

            case "Science Symbol":
                thePlayer.sciences[0]++;
                ChosenCard(aCard);     //Fictional Card
                break;

            case "Halikarnassos":
                filled = theMaster.discardPile.Count(x => x != null);
                for (int i = 0; i < filled; i++)
                {
                    if (theMaster.discardPile[i].name == theLabel.Text)
                    {
                        aCard = theMaster.discardPile[i];
                        break;
                    }
                }
                break;
            }

            if (mode != "Science Symbol")
            {
                if (!_CardForm.IsDisposed)
                {
                    _CardForm.Close();
                }
                _CardForm = new CardForm(aCard, this);
                _CardForm.Show();
            }
        }
コード例 #2
0
        private void labelClick(object sender, EventArgs e)
        {
            Label theLabel = (Label)sender;
            int   i;

            for (i = 0; i < 7; i++)
            {
                if (spaces[i] == theLabel)
                {
                    break;
                }
            }
            if (_CardForm == null)
            {
                _CardForm = new CardForm(theHand[i]);
            }
            else if (_CardForm.IsDisposed)
            {
                _CardForm = new CardForm(theHand[i]);
            }
            else
            {
                _CardForm.Close(); _CardForm = new CardForm(theHand[i]);
            }
            _CardForm.Show();
        }
コード例 #3
0
ファイル: Playerboard.cs プロジェクト: MatsJSvensson/7Wonders
        private void LabelClick(Label thisLabel, int mode)
        {
            Card[] SearchHand = thisPlayer.hand;

            if (mode == 2)
            {
                SearchHand = thisPlayer.builtCards;
            }
            else if (thisLabel.BackColor == Color.White)
            {
                SearchHand = thisPlayer.leaderHand;
            }
            if (thisLabel.BackColor == SystemColors.Control)
            {
                SearchHand = thisPlayer.wonderStages;
            }

            int  size     = SearchHand.Count(x => x != null);
            Card thisCard = SearchHand[0];

            for (int i = 0; i < size; i++)
            {
                if (thisLabel.Text == SearchHand[i].name)
                {
                    thisCard = SearchHand[i];
                    break;
                }
            }

            if (!_CardForm.IsDisposed)
            {
                _CardForm.Close();
            }
            _CardForm = new CardForm(thisCard, mode, this);
            _CardForm.Show();
        }