Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
 public Deck(DeckData deckData)
 {
     Cards = new List <Card>();
     foreach (CardData cardData in deckData.cards)
     {
         Cards.Add(new Card(this, cardData));
     }
     ReturnAndShuffle();
 }