public SerializableDeck AsSerializableDeck() { SerializableDeck serializableDeck = new SerializableDeck(); global::H.w one = this.get_Composition().GetOne <global::H.w>(); serializableDeck.Name = one.get_Name(); serializableDeck.A = ((this.local_deck != null) ? this.local_deck.DeckID : null); serializableDeck.Piles = new Dictionary <string, ArchetypeID[]>(); serializableDeck.Piles[Constants.K()] = this.cardsAsIdArray(); if (this.deck_avatars.get_Avatar() != null) { serializableDeck.Piles[Constants.Fy()] = new ArchetypeID[] { this.deck_avatars.get_Avatar().A }; } if (this.local_deck == null) { serializableDeck.Attributes = new MutableAttributes(); } else { serializableDeck.Attributes = new MutableAttributes(this.local_deck); } if (one is global::E.f) { serializableDeck.Attributes.GetAttribute <bool?>(global::g.D.L).set_Value(new bool?(((global::E.f)one).get_NameIsAutoGenerated())); serializableDeck.Attributes.ClearAttribute(global::g.D.b); serializableDeck.Attributes.ClearAttribute(global::g.D.get_Name()); } return(serializableDeck); }
private IEnumerator Start() { this.set_Validator(new global::h.N()); if (SceneManager.GetActiveScene().name != Constants.Px()) { EditDeckProvider provider = DataProvider.Get <EditDeckProvider>(); if (provider.get_Mode() == DeckEditorModes.Quest || provider.get_Mode() == DeckEditorModes.Conquest || provider.get_Mode() == DeckEditorModes.Chaos) { Archetypes archetypes = Finder.FindOrThrow <Archetypes>(); AdventureProvider adventure = AdventureProvider.Find(); while (adventure.SelectedAdventure.get_DeckInfo() == null) { yield return(null); } global::g.a a = new global::g.a(provider, archetypes, adventure.SelectedAdventure); this.subscriptionProvider.set_Data(a.get_Composition()); global::d.M one = Finder.FindOrThrow <AccountProvider>().get_Account().GetOne <global::d.M>(); int num = (int)((ArenaTiers)9 - ((provider.get_Mode() == DeckEditorModes.Quest) ? one.get_PvERank() : one.get_PvPRank())); string text = "rank=" + num + "\n"; foreach (ArchetypeID key in adventure.SelectedAdventure.get_Collection().A) { if (archetypes.get_All().ContainsKey(key)) { text = text + archetypes.get_All()[key].GetOne <NameData>().get_Name() + "\r\n"; } } try { File.WriteAllText((provider.get_Mode() == DeckEditorModes.Quest) ? "decks\\arena-solo.txt" : "decks\\arena.txt", text); } catch { } archetypes = null; adventure = null; archetypes = null; adventure = null; } provider = null; provider = null; } else { AsyncTournamentsProvider asyncTournamentsProvider = AsyncTournamentsProvider.Find(); AsyncTournamentDefinition selectedTournament = asyncTournamentsProvider.get_SelectedTournament(); if (selectedTournament != null && !selectedTournament.Run.AllowDeckSwitching) { Archetypes archetypes2 = Finder.FindOrThrow <Archetypes>(); AsyncTournamentProgress tournamentProgress = asyncTournamentsProvider.GetTournamentProgress(selectedTournament.ID); if (tournamentProgress != null) { SerializableDeck deck = tournamentProgress.Deck; global::A.I i = new global::A.I(asyncTournamentsProvider, archetypes2, selectedTournament, deck); this.subscriptionProvider.set_Data(i.get_Composition()); } } } yield break; yield break; }