public static ItemTooltipFoodNutrition Create(IProtoItemFood item) { var data = new FoodNutritionValueData(); data.Add(item, count: 1); return(new ItemTooltipFoodNutrition() { DataContext = data }); }
public static uint SharedCalculateFreshnessMaxValue(IProtoItemFood protoItemFood) { var freshnessDuration = protoItemFood.FreshnessDuration; var freshnessMaxValue = FreshnessFractionsPerSecond * (ulong)freshnessDuration.TotalSeconds; if (freshnessMaxValue > uint.MaxValue) { throw new Exception( $"Freshness duration exceeded max value of {TimeSpan.FromSeconds(uint.MaxValue / (double)FreshnessFractionsPerSecond)}." + $" Provided value is {freshnessDuration}"); } return((uint)freshnessMaxValue); }
public ProtoItemFoodViewModel([NotNull] IProtoItemFood food) : base(food) { }
public void ServerOnItemUsed(IProtoItemFood protoItemFood) { Api.ValidateIsServer(); AddIfNotContains(protoItemFood, this.ListFood); }
public void Add(IProtoItemFood protoItemFood, double count) { this.FoodRestore += protoItemFood.FoodRestore * count; this.StaminaRestore += protoItemFood.StaminaRestore * count; this.WaterRestore += protoItemFood.WaterRestore * count; }