public override void Decode(Hashtable data) { Cards = new List<NWCardDataObject>(); PlayerId = int.Parse(data[ePlayerDeckDataObjectKeys.PlayerId].ToString()); Hashtable deckData = (Hashtable)data[ePlayerDeckDataObjectKeys.DeckCards]; foreach (int cardKey in deckData.Keys) { NWCardDataObject card = new NWCardDataObject(cardKey, int.Parse(deckData[cardKey].ToString())); Cards.Add(card); } }
public NWPlayerDeckDataObject(int playerId, Hashtable deckData) { PlayerId = playerId; Cards = new List<NWCardDataObject>(); foreach (int cardKey in deckData.Keys) { Debug.Log("cardKey: " + cardKey); NWCardDataObject card = new NWCardDataObject(cardKey, int.Parse(deckData[cardKey].ToString())); Cards.Add(card); } }