public PlayerKeyInfo(Player p, List <CardDB.Card> ownDeck, bool ownTurn, Playfield pf) { this.maxMana = Math.Min(10, p.ownMaxMana); this.turn = p.ownController; this.heroInfo = new MinionKeyInfo(p.ownHero); List <MinionKeyInfo> minionList = new List <MinionKeyInfo>(); //List<float> minionValueList = new List<float>(); foreach (Minion m in p.ownMinions) { MinionKeyInfo minionInfo = new MinionKeyInfo(m); //float minionValue = off ? m.getOffMinionValue() : m.getDefMinionValue(); minionList.Add(minionInfo); //minionValueList.Add(minionValue); } this.minionJsonList = minionList; List <CardKeyInfo> hcList = new List <CardKeyInfo>(); foreach (Handmanager.Handcard hc in p.owncards) { CardKeyInfo hcInfo = new CardKeyInfo(hc, ownTurn, pf); hcList.Add(hcInfo); } this.handcardJsonList = hcList; this.ownDeckList = new List <string>(); foreach (CardDB.Card card in ownDeck) { this.ownDeckList.Add(card.name.ToString()); } }
public void updatePlayedCard(Player p, bool own, Playfield pf) { List <CardKeyInfo> playedCardList = new List <CardKeyInfo>(); foreach (Action action in p.lastTurnActions) { if (action.actionType == actionEnum.playcard) { CardKeyInfo pcInfo = new CardKeyInfo(action.card, own, pf); playedCardList.Add(pcInfo); } } this.playedCardJsonList = playedCardList; }