Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        private void labelClickRight(object sender, EventArgs e)
        {
            Label theLabel = (Label)sender;
            int   filled;
            Card  aCard = new Card();

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

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

            case "Courtesan":
                goto case "Olympus";

            case "Science Symbol":
                thePlayer.sciences[2]++;
                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();
            }
        }
Ejemplo n.º 3
0
        private void labelClickMid(object sender, EventArgs e)
        {
            Label theLabel = (Label)sender;
            int   filled;
            Card  aCard = new Card();

            switch (mode)
            {
            case "Science Symbol":
                thePlayer.sciences[1]++;
                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;

            case "Rome":
                for (int i = 0; i < thePlayer.leaderHand.Length; i++)
                {
                    if (thePlayer.leaderHand[i].name == theLabel.Text)
                    {
                        aCard = thePlayer.leaderHand[i]; break;
                    }
                }
                break;
            }

            if (mode != "Science Symbol")
            {
                if (!_CardForm.IsDisposed)
                {
                    _CardForm.Close();
                }
                _CardForm = new CardForm(aCard, this);
                _CardForm.Show();
            }
        }
Ejemplo n.º 4
0
        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();
        }