示例#1
0
        public Deck(string characterName, IPlayer.PlayerType playerType)
        {
            var files = Directory.GetFiles(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + "\\Images\\"+playerType+"\\" + characterName);
            cards = new List<Card>();

            foreach (var fileName in files)
            {
                var cardTitle = Path.GetFileNameWithoutExtension(fileName);

                if (fileName.Contains(Utility.splitDelimeter))
                {
                    var number = Utility.getNumOfCards(cardTitle);
                    var title = Utility.removeNumOfCards(cardTitle);

                    Console.WriteLine("\n" + title);
                    for (int k = 0; k < number; k++)
                    {
                        Card card = new Card(fileName);
                        cards.Add(card);
                    }

                }
                else
                {
                    Card card = new Card(fileName);
                    cards.Add(card);
                }
            }
        }
示例#2
0
 public void SendToGraveyard(IPlayer player, List<Card> currentList)
 {
     if(CardDestroyed != null)
         CardDestroyed(this, null);
     currentList.Remove(this);
     player.graveyard.Add(this);
 }
        private void addHealthLabel(IPlayer playerRujisMom, int row)
        {
            Label playerHealthLabel = new Label();
            playerHealthLabel.Width = 50;
            playerHealthLabel.Height = 40;

            playerHealthLabel.Content = playerRujisMom.lifeTotal;
            Utility.addElementToGrid(playerHealthLabel, row, 0, gridLayout);
        }
 private List<string> getDeckCardsString(IPlayer p)
 {
     var L = new List<string>();
     var deckAndHand= p.deck.cards;
     deckAndHand.AddRange(((Hero)p).hand);
     foreach (var card in deckAndHand)
         L.Add(card.getName());
     return L;
 }