Example #1
0
        /// <param name="version">string</param>
        /// <param name="player">Paritee.StardewValleyAPI.Players</param>
        /// <returns>Returns Paritee.StardewValleyAPI.FarmAnimals.Variations.Void</returns>
        public VoidVariation GetVoidFarmAnimals(string version, Player player)
        {
            if (!this.IsVersionSupported(version))
            {
                throw new NotSupportedException();
            }

            VoidConfig voidConfig = new VoidConfig(this.Config.VoidFarmAnimalsInShop, player.HasCompletedQuest(VoidVariation.QUEST_ID));

            return(new VoidVariation(voidConfig));
        }
        private AnimalShop GetAnimalShop(Player player)
        {
            // Set up everything else
            BlueConfig    blueConfig      = new BlueConfig(player.HasSeenEvent(BlueVariation.EVENT_ID));
            BlueVariation blueFarmAnimals = new BlueVariation(blueConfig);

            VoidConfig    voidConfig      = new VoidConfig(this.Config.VoidFarmAnimalsInShop, player.HasCompletedQuest(VoidVariation.QUEST_ID));
            VoidVariation voidFarmAnimals = new VoidVariation(voidConfig);

            List <FarmAnimalForPurchase> farmAnimalsForPurchase = this.Config.GetFarmAnimalsForPurchase(Game1.getFarm());
            StockConfig stockConfig = new StockConfig(farmAnimalsForPurchase, blueFarmAnimals, voidFarmAnimals);
            Stock       stock       = new Stock(stockConfig);

            return(new AnimalShop(stock));
        }
Example #3
0
        private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
        {
            this.Player = new Player(Game1.player, this.Helper);

            // Set up everything else
            BlueConfig blueConfig = new BlueConfig(this.Player.HasSeenEvent(BlueVariation.EVENT_ID));

            this.BlueFarmAnimals = new BlueVariation(blueConfig);

            VoidConfig voidConfig = new VoidConfig(this.Config.VoidFarmAnimalsInShop, this.Player.HasCompletedQuest(VoidVariation.QUEST_ID));

            this.VoidFarmAnimals = new VoidVariation(voidConfig);

            List <FarmAnimalForPurchase> farmAnimalsForPurchase = this.Config.GetFarmAnimalsForPurchase(Game1.getFarm());
            StockConfig stockConfig = new StockConfig(farmAnimalsForPurchase, this.BlueFarmAnimals, this.VoidFarmAnimals);
            Stock       stock       = new Stock(stockConfig);

            this.AnimalShop = new AnimalShop(stock);
        }
Example #4
0
        private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e)
        {
            this.Player = new Player(Game1.player, this.Helper);

            // Set up everything else
            BlueConfig blueConfig = new BlueConfig(this.Player.HasSeenEvent(Blue.EVENT_ID));

            this.BlueFarmAnimals = new Blue(blueConfig);

            VoidConfig voidConfig = new VoidConfig(this.Config.VoidFarmAnimalsInShop, this.Player.HasCompletedQuest(Void.QUEST_ID));

            this.VoidFarmAnimals = new Void(voidConfig);

            Dictionary <Stock.Name, string[]> available = this.Config.MapFarmAnimalsToAvailableAnimalShopStock();
            StockConfig stockConfig = new StockConfig(available, this.BlueFarmAnimals, this.VoidFarmAnimals);
            Stock       stock       = new Stock(stockConfig);

            this.AnimalShop = new AnimalShop(stock);
        }
Example #5
0
        static Config()
        {
            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }

            if (!File.Exists($@"{folder}/{configFile}"))
            {
                Void = new VoidConfig();
                string json = JsonConvert.SerializeObject(Void, Formatting.Indented);

                File.WriteAllText($@"./{folder}/{configFile}", json);
            }
            else
            {
                string json = File.ReadAllText($@"./{folder}/{configFile}");
                Void = JsonConvert.DeserializeObject <VoidConfig>(json);
            }
        }
Example #6
0
        /// <param name="player">Paritee.StardewValleyAPI.Players</param>
        /// <returns>Returns Paritee.StardewValleyAPI.FarmAnimals.Variations.Void</returns>
        public Void GetVoidFarmAnimals(Player player)
        {
            VoidConfig voidConfig = new VoidConfig(this.Config.VoidFarmAnimalsInShop, player.HasCompletedQuest(Void.QUEST_ID));

            return(new Void(voidConfig));
        }