Beispiel #1
0
 public ItemEatData(
     IItem item,
     ICharacter character,
     PlayerCharacterCurrentStats currentStats,
     FoodFreshness freshness)
 {
     this.Item         = item;
     this.Character    = character;
     this.CurrentStats = currentStats;
     this.Freshness    = freshness;
 }
        /// <summary>
        /// Gets the food positive effects coefficient depending on the food freshness.
        /// </summary>
        public static float SharedGetFreshnessPositiveEffectsCoef(FoodFreshness freshness)
        {
            switch (freshness)
            {
            case FoodFreshness.Green:
                return(1.0f);

            case FoodFreshness.Yellow:
                return(0.7f);

            case FoodFreshness.Red:
                return(0.4f);

            default:
                throw new ArgumentOutOfRangeException(nameof(freshness), freshness, null);
            }
        }