Ejemplo n.º 1
0
        public static void Spend(global::StardewValley.Farmer farmer, int amount, Utilities.Currency.Type currency)
        {
            switch (currency)
            {
            case Utilities.Currency.Type.Money:
                farmer.Money = Math.Max(Utilities.Currency.MinimumAmount, farmer.Money - amount);
                break;

            case Utilities.Currency.Type.FestivalScore:
                farmer.festivalScore = Math.Max(Utilities.Currency.MinimumAmount, farmer.festivalScore - amount);
                break;

            case Utilities.Currency.Type.ClubCoins:
                farmer.clubCoins = Math.Max(Utilities.Currency.MinimumAmount, farmer.clubCoins - amount);
                break;
            }
        }
Ejemplo n.º 2
0
        public static bool CanAfford(global::StardewValley.Farmer farmer, int amount, Utilities.Currency.Type currency = Utilities.Currency.Type.Money)
        {
            switch (currency)
            {
            case Utilities.Currency.Type.Money:
                return(farmer.Money >= amount);

            case Utilities.Currency.Type.FestivalScore:
                return(farmer.festivalScore >= amount);

            case Utilities.Currency.Type.ClubCoins:
                return(farmer.clubCoins >= amount);

            default:
                return(false);
            }
        }