public Deck LoadDeck() { string deckDataJson = File.ReadAllText(Application.streamingAssetsPath + DECK_PATH); DeckData deckData = JsonUtility.FromJson <DeckData>(deckDataJson); Debug.Log("Deck Loaded"); return(new Deck(deckData)); }
public void SaveDeck(Deck deck) { deck.SortDeck(); DeckData deckData = new DeckData(deck); string deckDataJson = JsonUtility.ToJson(deckData); File.WriteAllText(Application.streamingAssetsPath + DECK_PATH, deckDataJson); Debug.Log("Deck Saved"); }
public Deck(DeckData deckData) { Cards = new List <Card>(); foreach (CardData cardData in deckData.cards) { Cards.Add(new Card(this, cardData)); } ReturnAndShuffle(); }