private string GetCharactersForPivotalEvent(EventCard card)
 {
     var str = "->  ";
     var characters = card.Characters;
     foreach (var character in characters)
     {
         str += character + ". ";
     }
     return str;
 }
Пример #2
0
 public bool AddPivotalEventCard(EventCard card)
 {
     var numberOfCardsInHand = _pivotalEventCards.Count();
     if (numberOfCardsInHand < 6)
     {
         _pivotalEventCards.Add(card);
         return true;
     }
     return false;
 }
Пример #3
0
 public void AddPivotalEventCard(EventCard cardToAdd, EventCard cardToRemove)
 {
     for (int i = 0; i < 6; i++)
     {
         if (_pivotalEventCards[i].Name.Equals(cardToRemove.Name))
         {
             _pivotalEventCards.RemoveAt(i);
             _pivotalEventCards.Add(cardToAdd);
         }
     }
 }
Пример #4
0
 private void AddEventCardToHand(EventCard card)
 {
     if (!_game.AddCardToHand(_playerId, CardType.EVENT, card))
     {
         var swapCards = new SwapCardForm(card, _game.GetPlayersPivotalEventCards(_playerId), CardType.EVENT);
         swapCards.ShowDialog();
         if (swapCards.DialogResult == DialogResult.OK)
         {
             var discardedCard = (EventCard)swapCards.CardToBeRemoved;
             _game.AddCardToHand(_playerId, CardType.EVENT, card, discardedCard);
         }
     }
     SetPlayerScreen();
 }
Пример #5
0
        private List<EventCard> ReadEventsFromTxtFile(string eventCardFile)
        {
            var eventLines = File.ReadAllLines(eventCardFile);
            var eventCardList = new List<EventCard>();
            foreach (var line in eventLines)
            {
                var cardStringList = line.Split(new char[] { ':' });
                var name = cardStringList[0];
                var season = cardStringList[1];
                var type = cardStringList[2];

                var eventCard = new EventCard()
                {
                    Name = name,
                    Season = Convert.ToInt32(season),
                    EventCardType = type == "P" ? EventCardType.PIVOTAL : EventCardType.STANDARD
                };

                if (eventCard.EventCardType == EventCardType.PIVOTAL)
                {
                    eventCard.Characters = new List<string>();
                    for (int i = 3; i < cardStringList.Count(); i++)
                    {
                        eventCard.Characters.Add(cardStringList[i]);
                    }
                }
                eventCardList.Add(eventCard);
            }
            return eventCardList;
        }
Пример #6
0
 public bool AddStandardEventCard(EventCard card)
 {
     _standardEventCards.Add(card);
     return true;
 }