private void ShowHand()
 {
     for (int i = 0; i < HandCardPictureBoxes.Count(); i++)
     {
         HandCardPictureBoxes[i].Show();
         HandCardPictureBoxes[i].Image = CardSpriteGenerator.GetApropriateSprite(Game.Player.OwnedCards[i]);
     }
 }
Beispiel #2
0
        private void PathCardSelected()
        {
            PictureBoxPathPos1.Show();
            PictureBoxPathPos2.Show();
            ButtonDiscardCard.Show();

            Game.Player.SelectedCard.IsPathUpside = false;
            PictureBoxPathPos1.Image = new Bitmap(CardSpriteGenerator.GetApropriateSprite(Game.Player.SelectedCard), new Size(85, 111));
            CardSet flipedCard = new CardSet();

            flipedCard.Path          = Game.Player.SelectedCard.Path;
            flipedCard.PathOpenings  = Game.Player.SelectedCard.PathOpenings;
            flipedCard.Type          = CardType.Path;
            flipedCard.IsPathUpside  = true;
            PictureBoxPathPos2.Image = new Bitmap(CardSpriteGenerator.GetApropriateSprite(flipedCard), new Size(85, 111));
        }
 private void ShowField()
 {
     foreach (PictureBox fieldTile in fieldTiles)
     {
         fieldTile.Image = Properties.Resources.EmptyTile;
     }
     foreach (CardSet card in Game.Cards.Where(card => card.Owner == "Field"))
     {
         if (card.Type == CardType.Path)
         {
             fieldTiles[(int)card.FieldCol - 1, (int)card.FieldRow - 1].Image = new Bitmap(CardSpriteGenerator.GenerateCardSprite(card), new Size(85, 111));
         }
         if (card.Type == CardType.GoalPath)
         {
             fieldTiles[(int)card.FieldCol - 1, (int)card.FieldRow - 1].Image = Properties.Resources.BackCard;
         }
     }
 }
Beispiel #4
0
        private void TileSelectPathCard(object sender)
        {
            BlockType?playerBlocks = Game.Players.Where(player => player.Name == Game.Player.Name).First().Blocks;

            if (playerBlocks == null || playerBlocks == 0)
            {
                List <int[]> availableSpots = Game.AvailableFieldTiles(Game.Player.SelectedCard);
                for (int i = 0; i < availableSpots.Count; i++)
                {
                    if (fieldTiles[availableSpots[i][0] - 1, availableSpots[i][1] - 1] == sender)
                    {
                        fieldTiles[availableSpots[i][0] - 1, availableSpots[i][1] - 1].Image = new Bitmap(CardSpriteGenerator.GetApropriateSprite(Game.Player.SelectedCard), new Size(85, 111));
                        Game.Player.SelectedCard.FieldCol = availableSpots[i][0];
                        Game.Player.SelectedCard.FieldRow = availableSpots[i][1];
                        Game.Player.SelectedCard.Owner    = "Field";
                        Game.CheckGoalCardReached(Game.Player.SelectedCard);
                        EndTurn();
                        break;
                    }
                }
                ShowField();
            }
        }