/// <summary> /// Сохранить колоду БМО /// </summary> /// <param name="path">Путь, куда будет сохранен файл-результат</param> private static void SaveBmoDeck(string path) { using var stream = new FileStream(path + "bmo_deck", FileMode.OpenOrCreate); var formatter = new BinaryFormatter(); var deck = new SerializedDeck { HeroLogoPath = "Sprites/Cards/Heroes/BMO_small", DeckName = "Бимо", Cards = new List <SerializedCard> { #region Entities new SerializedCard("Blonde MerWitch", "Sprites/Cards/RainbowCards/Blonde_MerWitch", (int)LandType.RainbowLands, (int)CardType.Entity, "", 2, 3, 9), new SerializedCard("Chest Burster Gold", "Sprites/Cards/BMO/Chest_Burster_Gold", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 1, 10), new SerializedCard("Dark Angel Gold", "Sprites/Cards/BMO/Dark_Angel_Gold", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 0, 5), new SerializedCard("Dr. Death Gold", "Sprites/Cards/BMO/Dr._Death_Gold", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 1, 7), new SerializedCard("Extraordinary Spider", "Sprites/Cards/BMO/Extraordinary_Spider", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 1, 7), new SerializedCard("Gray Eyebat", "Sprites/Cards/BMO/Gray_Eyebat", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 2, 7), new SerializedCard("Green Mermaid", "Sprites/Cards/BMO/Green_Mermaid", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 1, 9), new SerializedCard("Green Merman", "Sprites/Cards/BMO/Green_Merman", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 2, 0, 6), new SerializedCard("Hot Eyebat", "Sprites/Cards/BMO/Hot_Eyebat", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 4, 4), new SerializedCard("Immortal Maize Walker Gold", "Sprites/Cards/BMO/Immortal_Maize_Walker_Gold", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 2, 2, 8), new SerializedCard("Mace Stump Gold", "Sprites/Cards/BMO/Mace_Stump_Gold", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 3, 3), new SerializedCard("Mouthball", "Sprites/Cards/BMO/Mouthball", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 2, 4), new SerializedCard("Red Eyeling", "Sprites/Cards/BMO/Red_Eyeling", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 2, 6), new SerializedCard("Teeth Leaf Gold", "Sprites/Cards/BMO/Teeth_Leaf_Gold", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 2, 3, 10), new SerializedCard("Tree of Underneath Gold", "Sprites/Cards/BMO/Tree_of_Underneath_Gold", (int)LandType.UselessSwamps, (int)CardType.Entity, "", 1, 3, 3), new SerializedCard("Wandering Bald Man Gold", "Sprites/Cards/RainbowCards/Wandering_Bald_Man_Gold", (int)LandType.RainbowLands, (int)CardType.Entity, "", 0, 0, 10), #endregion #region Buildings // GlobalGameContext.BmoAllCards.Add(new EntityCard("Blood_Fortress", "Sprites/Cards/BMO/Blood_Fortress", 0, 0)); // GlobalGameContext.BmoAllCards.Add(new EntityCard("Celestial_Castle", "Sprites/Cards/BMO/Celestial_Castle", 0, 0)); // GlobalGameContext.BmoAllCards.Add(new EntityCard("Palace_of_Bone", "Sprites/Cards/BMO/Palace_of_Bone", 0, 0)); // GlobalGameContext.BmoAllCards.Add(new EntityCard("Spirit_Tower", "Sprites/Cards/BMO/Spirit_Tower", 0, 0)); #endregion #region Spells // GlobalGameContext.BmoAllCards.Add(new EntityCard("Abraca_Amadeus", "Sprites/Cards/BMO/Abraca_Amadeus", 0, 0)); // GlobalGameContext.BmoAllCards.Add(new EntityCard("Bone_Wand", "Sprites/Cards/BMO/Bone_Wand", 0, 0)); // GlobalGameContext.BmoAllCards.Add(new EntityCard("Magic_Ring_Ding", "Sprites/Cards/BMO/Magic_Ring_Ding", 0, 0)); // GlobalGameContext.BmoAllCards.Add(new EntityCard("Ogre_Gas", "Sprites/Cards/BMO/Ogre_Gas", 0, 0)); // GlobalGameContext.BmoAllCards.Add(new EntityCard("Snake_Eye_Ring", "Sprites/Cards/BMO/Snake_Eye_Ring", 0, 0)); #endregion } }; formatter.Serialize(stream, deck); }
/// <summary> /// Создать рандомную колоду /// </summary> private (string, List <EntityCard>) CreateRandomDeck(SerializedDeck serializedDeck) { var resultDeck = new List <EntityCard>(); foreach (var serializedCard in serializedDeck.Cards) { var card = new EntityCard(serializedCard, serializedDeck.IsCustomDeck); resultDeck.Add(card); } return(serializedDeck.HeroLogoPath, resultDeck); }
/// <summary> /// Сохранить колоду Леди Ливнерог /// </summary> /// <param name="path">Путь, куда будет сохранен файл-результат</param> private static void SaveLadyRainiCornDeck(string path) { using var stream = new FileStream(path + "lady_rainicorn", FileMode.Create); var formatter = new BinaryFormatter(); var deck = new SerializedDeck { HeroLogoPath = "Sprites/Cards/Heroes/Lady_Rainicorn_small", DeckName = "Леди Ливнерог", Cards = new List <SerializedCard> { #region Entities new SerializedCard("Beach_Mummy", "Sprites/Cards/LadyRainicorn/Beach_Mummy", (int)LandType.SandLands, (int)CardType.Entity, "", 1, 0, 7), new SerializedCard("Fummy", "Sprites/Cards/LadyRainicorn/Fummy", (int)LandType.SandLands, (int)CardType.Entity, "", 1, 2, 7), new SerializedCard("Wall_Of_Sand", "Sprites/Cards/LadyRainicorn/Wall_Of_Sand", (int)LandType.SandLands, (int)CardType.Entity, "", 2, 1, 12), new SerializedCard("Sandwitch", "Sprites/Cards/LadyRainicorn/Sandwitch", (int)LandType.SandLands, (int)CardType.Entity, "", 1, 0, 12), new SerializedCard("Shark", "Sprites/Cards/LadyRainicorn/Shark", (int)LandType.SandLands, (int)CardType.Entity, "", 2, 2, 10), new SerializedCard("The_Mariachi", "Sprites/Cards/LadyRainicorn/The_Mariachi", (int)LandType.SandLands, (int)CardType.Entity, "", 2, 2, 9), new SerializedCard("Sandsnake", "Sprites/Cards/LadyRainicorn/Sandsnake", (int)LandType.SandLands, (int)CardType.Entity, "", 1, 0, 9), new SerializedCard("Green_Cactaball", "Sprites/Cards/LadyRainicorn/Green_Cactaball", (int)LandType.SandLands, (int)CardType.Entity, "", 1, 0, 4), new SerializedCard("Lost_Golem", "Sprites/Cards/LadyRainicorn/Lost_Golem", (int)LandType.SandLands, (int)CardType.Entity, "", 3, 5, 6), new SerializedCard("Sand_Eyebat", "Sprites/Cards/LadyRainicorn/Sand_Eyebat", (int)LandType.SandLands, (int)CardType.Entity, "", 2, 1, 10), new SerializedCard("Sand_Knight", "Sprites/Cards/LadyRainicorn/Sand_Knight", (int)LandType.SandLands, (int)CardType.Entity, "", 1, 1, 8), new SerializedCard("Sandhorn_Devil", "Sprites/Cards/LadyRainicorn/Sandhorn_Devil", (int)LandType.SandLands, (int)CardType.Entity, "", 1, 3, 6), new SerializedCard("Sand_Angel", "Sprites/Cards/RainbowCards/Sand_Angel", (int)LandType.RainbowLands, (int)CardType.Entity, "", 0, 1, 5), new SerializedCard("Ms._Mummy", "Sprites/Cards/RainbowCards/Ms._Mummy", (int)LandType.RainbowLands, (int)CardType.Entity, "", 0, 1, 4), new SerializedCard("Peach_Djini", "Sprites/Cards/RainbowCards/Peach_Djini", (int)LandType.RainbowLands, (int)CardType.Entity, "", 0, 0, 6), #endregion #region Buildings // new SerializedCard("Sand_Sphinx", "Sprites/Cards/LadyRainicorn/Sand_Sphinx", (int)LandType.SandLands, (int)CardType.Building, "", 2, null, null), // new SerializedCard("ZaZo's_Magic_Seeds", "Sprites/Cards/RainbowCards/ZaZo's_Magic_Seeds", (int)LandType.RainbowLands, (int)CardType.Building, "", 0, null, null), // new SerializedCard("Blood_Fortress", "Sprites/Cards/RainbowCards/Blood_Fortress", (int)LandType.RainbowLands, (int)CardType.Building, "", 1, null, null), // new SerializedCard("Celestial_Castle", "Sprites/Cards/RainbowCards/Celestial_Castle", (int)LandType.RainbowLands, (int)CardType.Building, "", 0, null, null), #endregion #region Spells // new SerializedCard("Teleport", "Sprites/Cards/RainbowCards/Teleport", (int)LandType.RainbowLands, (int)CardType.Spell, "", 0, null, null), // new SerializedCard("Cerebral_Bloodstorm", "Sprites/Cards/RainbowCards/Cerebral_Bloodstorm", (int)LandType.RainbowLands, (int)CardType.Spell, "", 1, null, null), // new SerializedCard("Unempty_Coffin", "Sprites/Cards/RainbowCards/Unempty_Coffin", "Sprites/Cards/Frames/RainbowCards", (int)CardType.Spell, "", 0, null, null), #endregion } }; formatter.Serialize(stream, deck); }