Exemple #1
0
 void PrepareGame()
 {
     Debug.Log("PrepareGame");
     foreach (var username in players.Keys)
     {
         string deckGuid = System.Guid.NewGuid().ToString();
         var    filename = string.Concat(Application.temporaryCachePath, "/", deckGuid);
         var    sr       = File.CreateText(filename);
         var    player   = players[username].GetComponent <XMPPPlayer>();
         sr.WriteLine(player.deckString);
         sr.Close();
         DeckCardLists l = DeckImporter.importDeckFromFile(filename, true);
         Deck          d = Deck.load(l, false, false);
         Debug.Log(player.magePlayer.getId().ToString());
         mageGame.loadCards(d.getCards(), player.magePlayer.getId());
         mageGame.loadCards(d.getSideboard(), player.magePlayer.getId());
         mageGame.addPlayer(player.magePlayer, d);
     }
 }