Пример #1
0
        /// <summary>
        /// Increment the given stats for the given amout
        /// </summary>
        /// <param name="stats">The stat to increment</param>
        /// <param name="amount">The amount to increment</param>
        public static void IncrementStardewStats(StardewStats stats, int amount = 1)
        {
            switch (stats)
            {
            case StardewStats.PiecesOfTrashRecycled:
                Game1.stats.PiecesOfTrashRecycled += (uint)amount;
                break;

            case StardewStats.GoatCheeseMade:
                Game1.stats.GoatCheeseMade += (uint)amount;
                break;

            case StardewStats.CheeseMade:
                Game1.stats.CheeseMade += (uint)amount;
                break;

            case StardewStats.PreservesMade:
                Game1.stats.PreservesMade += (uint)amount;
                break;

            case StardewStats.BeveragesMade:
                Game1.stats.BeveragesMade += (uint)amount;
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// Increment the given stats for the given amout
        /// </summary>
        /// <param name="stats">The stat to increment</param>
        /// <param name="amount">The amount to increment</param>
        public static void IncrementStardewStats(StardewStats stats, int amount = 1)
        {
            var statusValue = ProducerFrameworkModEntry.Helper.Reflection.GetProperty <uint>(Game1.stats, stats.ToString());

            statusValue.SetValue(statusValue.GetValue() + (uint)amount);
        }