public GameDetailItem(TurnStats.Play play, int turn)
		{
			Turn = turn.ToString();
			Player = play.Type.ToString().StartsWith("Player") ? "Player" : "Opponent";
			Action = play.Type.ToString().Replace("Player", string.Empty).Replace("Opponent", string.Empty);
			Card = Database.GetCardFromId(play.CardId);

			if(play.Type == PlayType.PlayerHandDiscard || play.Type == PlayType.OpponentHandDiscard && (Card != null && Card.Type == "Spell"))
				Action = "Play/Discard";
		}
        public void AddPlay(PlayType type, int turn, string cardId)
        {
            var turnStats = TurnStats.FirstOrDefault(t => t.Turn == turn);

            if (turnStats == null)
            {
                turnStats = new TurnStats {
                    Turn = turn
                };
                TurnStats.Add(turnStats);
            }
            turnStats.AddPlay(type, cardId);
        }
Example #3
0
        public void AddPlay(PlayType type, int turn, string cardId)
        {
            var turnStats = TurnStats.FirstOrDefault(t => t.Turn == turn);

            if (turnStats == null)
            {
                turnStats = new TurnStats {
                    Turn = turn
                };
                TurnStats.Add(turnStats);
            }
            turnStats.AddPlay(type, cardId);
            Logger.WriteLine(string.Format("New play: {0} ({1}, turn: {2})", type, cardId, turn), "GameStats");
        }
        public Deck GetOpponentDeck()
        {
            var ignoreCards = new List <Card>();
            var deck        = new Deck {
                Class = OpponentHero
            };

            foreach (var play in TurnStats.SelectMany(turn => turn.Plays))
            {
                switch (play.Type)
                {
                case OpponentPlay:
                case OpponentDeckDiscard:
                case OpponentHandDiscard:
                case OpponentSecretTriggered:
                {
                    var card = Database.GetCardFromId(play.CardId);
                    if (Database.IsActualCard(card) && (card.PlayerClass == null || card.PlayerClass == OpponentHero))
                    {
                        if (ignoreCards.Contains(card))
                        {
                            ignoreCards.Remove(card);
                            continue;
                        }
                        var deckCard = deck.Cards.FirstOrDefault(c => c.Id == card.Id);
                        if (deckCard != null)
                        {
                            deckCard.Count++;
                        }
                        else
                        {
                            deck.Cards.Add(card);
                        }
                    }
                }
                break;

                case OpponentBackToHand:
                {
                    var card = Database.GetCardFromId(play.CardId);
                    if (Database.IsActualCard(card))
                    {
                        ignoreCards.Add(card);
                    }
                }
                break;
                }
            }
            return(deck);
        }
Example #5
0
        public void AddPlay(PlayType type, int turn, string cardId)
        {
            var turnStats = TurnStats.FirstOrDefault(t => t.Turn == turn);

            if (turnStats == null)
            {
                turnStats = new TurnStats {
                    Turn = turn
                };
                TurnStats.Add(turnStats);
            }
            turnStats.AddPlay(type, cardId);
            Logger.WriteLine($"New play: {type} ({cardId}, turn: {turn})", "GameStats", 2);
        }
 public void AddPlay(PlayType type, int turn, string cardId)
 {
     var turnStats = TurnStats.FirstOrDefault(t => t.Turn == turn);
     if(turnStats == null)
     {
         turnStats = new TurnStats {Turn = turn};
         TurnStats.Add(turnStats);
     }
     turnStats.AddPlay(type, cardId);
     Logger.WriteLine(string.Format("New play: {0} ({1}, turn: {2})", type, cardId, turn), "GameStats");
 }
		public void AddPlay(PlayType type, int turn, string cardId)
		{
			var turnStats = TurnStats.FirstOrDefault(t => t.Turn == turn);
			if(turnStats == null)
			{
				turnStats = new TurnStats {Turn = turn};
				TurnStats.Add(turnStats);
			}
			turnStats.AddPlay(type, cardId);
		}
		public void AddPlay(PlayType type, int turn, string cardId)
		{
			var turnStats = TurnStats.FirstOrDefault(t => t.Turn == turn);
			if(turnStats == null)
			{
				turnStats = new TurnStats {Turn = turn};
				TurnStats.Add(turnStats);
			}
			turnStats.AddPlay(type, cardId);
			Logger.WriteLine($"New play: {type} ({cardId}, turn: {turn})", "GameStats", 2);
		}