Exemplo n.º 1
0
        public ItemFood(ItemFoodModel model, int qty = 1) : base(model, qty)
        {
#if DEBUG
            if (model.IsPerishable)
            {
                throw new InvalidOperationException("wrong constructor");
            }
#endif
            Nutrition = model.Nutrition;
        }
Exemplo n.º 2
0
        public ItemFood(int bestBefore, ItemFoodModel model) : base(model)
        {
#if DEBUG
            if (0 > bestBefore)
            {
                throw new InvalidOperationException("expired in past");
            }
            if (!model.IsPerishable)
            {
                throw new InvalidOperationException("wrong constructor");
            }
#endif
            Nutrition  = model.Nutrition;
            BestBefore = new WorldTime(bestBefore);
        }