Beispiel #1
0
    private void  initStates()
    {
        takeState = Take.Start;
        activateState = Activate.Start;
        deactivateState = Deactivate.Start;
        releaseState = Release.Start;
        tasteState = Taste.Start;
        smellState = Smell.Start;

        /*openDoorState = OpenDoor.Start;
        closeDoorState = CloseDoor.Start;*/
        moveState = Move.Start;
        rotateState = Rotate.Start;
        turnState = Turn.Start;
        commandStatus = CommandStatus.Running;
        headFocusState = HeadFocus.Start;
        headResetState = HeadReset.Start;
        lookForState = LookFor.Start;

        speakState = Speak.Start;

        cancelState = Cancel.Start;
        getSensesState = GetSenses.Start;

        reset = true;           
    }
Beispiel #2
0
 /// <summary>
 /// Constructor of an apple class. If nothing is specified, creates a random characteristics.
 /// </summary>
 /// <param name="color">Color of an apple. Red by default.</param>
 /// <param name="size">Size of an apple. Cherry by default.</param>
 /// <param name="taste">Taste of an apple. Bitter by default.</param>
 /// <param name="rotteness">Rotteness of an apple. Fresh by default.</param>
 public Apple(Color color = Color.Red, Size size = Size.Cherry, Taste taste = Taste.Bitter, Rotteness rotteness = Rotteness.Fresh)
 {
     this.color     = color;
     this.size      = size;
     this.taste     = taste;
     this.rotteness = rotteness;
 }
 public async void CreateTaste(Taste taste)
 {
     if (taste != null)
     {
         await _mongoDataProvider.CreateTaste(taste);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Constructor of an apple class. If nothing is specified, creates a random characteristics.
 /// </summary>
 /// <param name="color">Color of an apple. Red by default.</param>
 /// <param name="size">Size of an apple. Cherry by default.</param>
 /// <param name="taste">Taste of an apple. Bitter by default.</param>
 /// <param name="rotteness">Rotteness of an apple. Fresh by default.</param>
 public Apple()
 {
     this.color     = (Color)rand.Next(0, Enum.GetNames(typeof(Color)).Length);
     this.size      = (Size)rand.Next(0, Enum.GetNames(typeof(Size)).Length);
     this.taste     = (Taste)rand.Next(0, Enum.GetNames(typeof(Taste)).Length);
     this.rotteness = (Rotteness)rand.Next(0, Enum.GetNames(typeof(Rotteness)).Length);
 }
Beispiel #5
0
        public async Task SeedAsync(ApplicationDbContext dbContext, IServiceProvider serviceProvider)
        {
            if (dbContext.Tastes.Any())
            {
                return;
            }

            var list = new List <Taste>();

            for (int i = 0; i < CigarSeedDataConstants.TesteList.Length; i++)
            {
                var tasteType = CigarSeedDataConstants.TesteList[i].Trim();

                var currentTaste = new Taste
                {
                    TasteType = tasteType,
                    ImageUrl  = CigarSeedDataConstants.TastePictures[tasteType],
                    CreatedOn = DateTime.UtcNow,
                    IsDeleted = false,
                };

                var taste = list.FirstOrDefault(x => x.TasteType == currentTaste.TasteType);

                if (taste is null)
                {
                    list.Add(currentTaste);
                }
            }

            await dbContext.Tastes.AddRangeAsync(list);

            await dbContext.SaveChangesAsync();
        }
 public Accompaniment(string name, Taste foodTaste, float timeToCook, cookingType currentCookingType)
 {
     this.name = name;
     this.foodTaste = foodTaste;
     this.timeToCook = timeToCook;
     this.currentCookingMethod = currentCookingMethod;
     this.typeOfItem = itemType.food;
 }
Beispiel #7
0
 public override Enums.Response ProcessPacket(LightingConsole console, int type)
 {
     for (int i = 0; i < LampStates.Length /* =256 */; i++)
     {
         Taste taste = console.TastenManager.FindByNumber(i);
         if (taste != null)
         {
             taste.State = LampStates[i];
         }
     }
     return(Enums.Response.OK);
 }
Beispiel #8
0
 private void end()
 {
     switch (action)
     {
         case Action.Take:
             takeState = Take.End;
             break;
         case Action.Activate:
             activateState = Activate.End;
             break;
         case Action.Deactivate:
             deactivateState = Deactivate.End;
             break;
         case Action.Release:
             releaseState = Release.End;
             break;
         case Action.Taste:
             tasteState = Taste.End;
             break;
         case Action.Smell:
             smellState = Smell.End;
             break;
         case Action.Move:
             moveState = Move.End;
             break;                
         case Action.Rotate:
             rotateState = Rotate.End;
             break;
         case Action.Turn:
               turnState = Turn.End;
               break;
         case Action.HeadFocus:
             headFocusState = HeadFocus.End;
             break;
         case Action.HeadReset:
             headResetState = HeadReset.End;
             break;
         case Action.LookFor:
             lookForState = LookFor.End;
             break;
         case Action.Speak:
             speakState = Speak.End;
             break;
         case Action.Cancel:
             cancelState = Cancel.End;
             break;
         case Action.GetSenses:
             getSensesState = GetSenses.End;
             break;
         default:
             break; ;
     }   
 }
        public ActionResult Create(Taste taste)
        {
            try
            {
                _wineRepository.AddTaste(taste);
                _wineRepository.Save();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(taste));
            }
        }
        private static void AddUniversalGiftTaste(IDictionary <string, string> data, Taste taste, params string[] values)
        {
            string key           = "Universal_" + taste;
            string currentValues = data[key];
            string valuesToAdd   = values
                                   .Where(v => !currentValues.Contains(v))
                                   .Aggregate(string.Empty, (workingSentence, next) => workingSentence + " " + next);

            if (valuesToAdd.Length > 0)
            {
                currentValues += valuesToAdd;
                data[key]      = currentValues.Trim();
            }
        }
        public ActionResult Delete(string id, FormCollection collection)
        {
            Taste taste = _wineRepository.FindTasteById(id);

            try
            {
                _wineRepository.DeleteTaste(taste);
                _wineRepository.Save();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Edit(string id, FormCollection collection)
        {
            Taste taste = _wineRepository.FindTasteById(id);

            try
            {
                UpdateModel(taste);
                _wineRepository.Save();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(taste));
            }
        }
Beispiel #13
0
        public static string ToPrice(Taste taste)
        {
            switch (taste)
            {
            case Taste.Undefined:
                return("");

            case Taste.Weak:
                return("R$ 15,00");

            case Taste.Soft:
                return("R$ 20,00");

            case Taste.Strong:
                return("R$ 25,00");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Beispiel #14
0
        public static string ToString(Taste taste)
        {
            switch (taste)
            {
            case Taste.Undefined:
                return("");

            case Taste.Weak:
                return("Fraco");

            case Taste.Soft:
                return("Suave");

            case Taste.Strong:
                return("Forte");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Beispiel #15
0
 public Food(int id, string name, ProductType type, double price, Taste taste, int calories) : base(id, name, type, price)
 {
     Taste    = taste;
     Calories = calories;
 }
Beispiel #16
0
        public Food CreateFood(int id, string nameOfProduct, TypeFED typeFED, double price, bool onPromotion, Taste taste, double calories)
        {
            Food newObject = new Food(id, nameOfProduct, typeFED, price, onPromotion, taste, calories);

            return(newObject);
        }
Beispiel #17
0
 public IActionResult Post([FromBody] Taste value)
 {
     _context.Tastes.Add(value);
     _context.SaveChanges();
     return(StatusCode(201, value));
 }
        private static void AddNpcGiftTaste(IDictionary <string, string> data, string npc, Taste taste, params string[] values)
        {
            string[] tastes        = data[npc].Split('/');
            string   currentValues = tastes[(int)taste];
            string   valuesToAdd   = values.Where(v => !currentValues.Contains(v)).Aggregate(string.Empty, (workingSentence, next) => workingSentence + " " + next);

            if (valuesToAdd.Length > 0)
            {
                currentValues     += valuesToAdd;
                tastes[(int)taste] = currentValues.Trim();
                data[npc]          = String.Join("/", tastes);
            }
        }
Beispiel #19
0
 public async Task CreateTaste(Taste taste)
 {
     await this.Tastes.InsertOneAsync(taste);
 }
 public ClientPrefs(FlavourGroup group = FlavourGroup.None, Taste taste = Taste.None, Strength strength = Strength.None)
 {
     this.group    = group;
     this.taste    = taste;
     this.strength = strength;
 }
Beispiel #21
0
 public JellyCandy(string candyname, double weightOfOne, string typeCandy, int sugarContentinOne, Taste taste)
     : base(candyname, weightOfOne, typeCandy, sugarContentinOne)
 {
 }
        public ActionResult Create()
        {
            Taste taste = new Taste();

            return(View(taste));
        }
        public ActionResult Edit(string id)
        {
            Taste taste = _wineRepository.FindTasteById(id);

            return(View(taste));
        }
Beispiel #24
0
 public Wafer(string name, int weight, int caloties, double price, Taste taste, bool glaze)
     : base(name, weight, caloties, price)
 {
     this.taste = taste;
     this.glaze = glaze;
 }
 public async Task <FehlerT> ReleaseKey(Taste taste) => await ReleaseKey((byte)taste.TastNr).ConfigureAwait(false);
Beispiel #26
0
 public void complexTaste(Taste taste)
 {
     this.salt += taste.salt;
     this.sweet += taste.sweet;
     this.bitter += taste.bitter;
     this.sour += taste.sour;
     this.umami += taste.umami;
     this.spicy += taste.spicy;
     this.tender += taste.tender;
     this.fat += taste.fat;
 }
 public async Task CreateTaste([FromBody] Taste taste)
 {
     await _mongoDataProvider.CreateTaste(taste);
 }
Beispiel #28
0
 public void FillWithTaste(CoffeeMachine cm, Taste t)
 {
     Console.WriteLine("TeaHerbs has been added in the filter of the " + cm.Brand);
 }
Beispiel #29
0
 public Food(int id, string nameOfProduct, TypeFED typeFED, double price, bool onPromotion, Taste taste, double calories) : base(id, nameOfProduct, typeFED, price, onPromotion)
 {
     Taste    = taste;
     Calories = calories;
 }
Beispiel #30
0
 public Flavour(FlavourGroup group, Taste taste)
 {
     this.group = group;
     this.taste = taste;
 }
Beispiel #31
0
 public IActionResult Create(Taste taste)
 {
     db.Tastes.Add(taste);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Beispiel #32
0
 private void changeStatus(int value)
 {
     if (commandStatus != CommandStatus.Fail && commandStatus != CommandStatus.Success)
     {
         switch (action)
         {
             case Action.Take:
                 if (takeState != Take.End)
                     takeState+=value;
                 break;
             case Action.Activate:
                 if (activateState != Activate.End)
                     activateState += value;
                 break;
             case Action.Deactivate:
                 if (deactivateState != Deactivate.End)
                     deactivateState += value;
                 break;
             case Action.Release:
                 if (releaseState != Release.End)
                     releaseState += value;
                 break;
             case Action.Taste:
                 if (tasteState != Taste.End)
                     tasteState += value;
                 break;
             case Action.Smell:
                 if (smellState != Smell.End)
                     smellState += value;
                 break;
             case Action.Move:
                 if (moveState != Move.End)
                     moveState+=value;
                 break;
             case Action.Rotate:
                  if (rotateState != Rotate.End)
                     rotateState+=value;
                 break;
             case Action.Turn:
                 if (turnState != Turn.End)
                      turnState+=value;
                break;
             case Action.HeadFocus:
                 if (headFocusState != HeadFocus.End)
                     headFocusState+=value;
                 break;
             case Action.HeadReset:
                 if (headResetState != HeadReset.End)
                     headResetState+=value;
                 break;
             case Action.LookFor:
                 if (lookForState != LookFor.End)
                     lookForState += value;
                 break;
             case Action.Speak:
                 if (speakState != Speak.End)
                    speakState += value;
                 break;
             case Action.Cancel:
                 if (cancelState != Cancel.End)
                     cancelState += value;
                 break;
             case Action.GetSenses:
                 if (getSensesState != GetSenses.End)
                     getSensesState += value;
                 break;
             default:
                 break;
         }
         commandStatus = CommandStatus.Running;
     }
 }