コード例 #1
0
        public new HashSet <string> GetSelectedFieldsList()
        {
            var hs = base.GetSelectedFieldsList();

            if (Smokes.Count > 0 && Smokes.Any(p => p > 0))
            {
                hs.Add("Smokes");
            }
            if (Alcohol.Count > 0 && Alcohol.Any(p => p > 0))
            {
                hs.Add("Alcohol");
            }
            if (Religion.Count > 0 && Religion.Any(p => p > 0))
            {
                hs.Add("Religion");
            }
            if (DickSize.Count > 0 && DickSize.Any(p => p > 0))
            {
                hs.Add("DickSize");
            }
            if (DickThickness.Count > 0 && DickThickness.Any(p => p > 0))
            {
                hs.Add("DickThickness");
            }
            if (BreastSize.Count > 0 && BreastSize.Any(p => p > 0))
            {
                hs.Add("BreastSize");
            }
            return(hs);
        }
コード例 #2
0
        public IDrink CreatedDrink(string drinkType,
                                   string drinkName,
                                   int drinkServingSize,
                                   string drinkBrand)

        {
            IDrink drinkToCreate = null;

            switch (drinkType.ToLower())
            {
            case "alcohol":
                drinkToCreate = new Alcohol(drinkName, drinkServingSize, drinkBrand);
                break;

            case "fuzzydrink":
                drinkToCreate = new FuzzyDrink(drinkName, drinkServingSize, drinkBrand);
                break;

            case "juice":
                drinkToCreate = new Juice(drinkName, drinkServingSize, drinkBrand);
                break;

            case "water":
                drinkToCreate = new Water(drinkName, drinkServingSize, drinkBrand);
                break;
            }
            return(drinkToCreate);
        }
コード例 #3
0
        public string AddDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink  = null;
            string output = string.Empty;

            if (type == "Alcohol")
            {
                drink = new Alcohol(name, servingSize, brand);
                drinks.Add(drink);
                output = $"Added {name} ({brand}) to the drink pool";
            }
            else if (type == "FuzzyDrink")
            {
                drink = new FuzzyDrink(name, servingSize, brand);
                drinks.Add(drink);
                output = $"Added {name} ({brand}) to the drink pool";
            }
            else if (type == "Juice")
            {
                drink = new Juice(name, servingSize, brand);
                drinks.Add(drink);
                output = $"Added {name} ({brand}) to the drink pool";
            }
            else if (type == "Water")
            {
                drink = new Water(name, servingSize, brand);
                drinks.Add(drink);
                output = $"Added {name} ({brand}) to the drink pool";
            }
            return(output);
        }
コード例 #4
0
        public static IDrink CreateDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink;

            switch (type)
            {
            case "Alcohol":
                drink = new Alcohol(name, servingSize, brand);
                break;

            case "Juice":
                drink = new Juice(name, servingSize, brand);
                break;

            case "FuzzyDrink":
                drink = new FuzzyDrink(name, servingSize, brand);
                break;

            case "Water":
                drink = new Water(name, servingSize, brand);
                break;

            default:
                drink = null;
                break;
            }

            return(drink);
        }
コード例 #5
0
        //---------------------------------------------------------------------------------------------------------------------------------------------------

        //Showing product information.
        private void ListForChoosingAlcohols_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            //Creating a new layout for showing information about product.
            AlertDialog.Builder Object   = new AlertDialog.Builder(this);
            LayoutInflater      inflater = LayoutInflater.From(this);
            LinearLayout        layout   = new LinearLayout(this);
            View alcohol_Info            = inflater.Inflate(Resource.Layout.alcohol_Info, layout);

            Object.SetView(alcohol_Info);

            //Elements from the layout.
            TextView NameText       = alcohol_Info.FindViewById <TextView>(Resource.Id.NameText);
            TextView PercentageText = alcohol_Info.FindViewById <TextView>(Resource.Id.PercentageText);
            TextView CcalsText      = alcohol_Info.FindViewById <TextView>(Resource.Id.CcalsText);

            //Temporary product for getting information about choosed product.
            Alcohol TempAlcohol = DatabaseAlcohol.GetAlcohol(ListForAlcohols.ElementAt(e.Position));

            //Showing information.
            NameText.Text       = TempAlcohol.Name;
            PercentageText.Text = TempAlcohol.PercentageOfAlchol.ToString();
            CcalsText.Text      = TempAlcohol.CCal.ToString();

            //Action on positive button.
            Object.SetPositiveButton(Resource.String.OK, new EventHandler <DialogClickEventArgs>(delegate(object Sender, DialogClickEventArgs e1) {}));

            //Showing the form.
            Object.Show();
        }
コード例 #6
0
        // GET: Alcohol/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                TempData["mensaje"] = "Especifique la condición.";
                return(RedirectToAction("Index"));
            }
            Alcohol alcohol = db.Alcohol.Find(id);

            if (alcohol != null)
            {
                if (alcohol.activo == 1)
                {
                    alcohol.estado_String = "Activo";
                }
                else
                {
                    alcohol.estado_String = "Inactivo";
                }
            }
            if (alcohol == null)
            {
                TempData["mensaje"] = "La condición no éxiste.";
                return(RedirectToAction("Index"));
            }
            ViewBag.ID_EXPEDIENTE = new SelectList(db.Expediente, "id", "ID_PACIENTE", alcohol.ID_EXPEDIENTE);
            return(View(alcohol));
        }
コード例 #7
0
ファイル: GameManager.cs プロジェクト: Jooky4/JamBatya
 // Start is called before the first frame update
 void Start()
 {
     Player  = Instantiate(prefabPlayer, pointSpawn.position, Quaternion.identity);
     alcohol = Player.GetComponent <Alcohol>();
     characterController2D = Player.GetComponent <CharacterController2D>();
     cameraManager         = Camera.GetComponent <CameraManager>();
 }
コード例 #8
0
        public string AddDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink = null;

            if (type == "Alcohol")
            {
                drink = new Alcohol(name, servingSize, brand);
            }
            else if (type == "FuzzyDrink")
            {
                drink = new FuzzyDrink(name, servingSize, brand);
            }

            else if (type == "Juice")
            {
                drink = new Juice(name, servingSize, brand);
            }

            else if (type == "Water")
            {
                drink = new Water(name, servingSize, brand);
            }

            if (drink != null)
            {
                this.drinks.Add(drink);
            }

            return($"Added {drink.Name} ({drink.Brand}) to the drink pool");
        }
コード例 #9
0
        public string AddDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink = null;

            switch (type.ToLower())
            {
            case "fuzzydrink":
                drink = new FuzzyDrink(name, servingSize, brand);
                break;

            case "juice":
                drink = new Juice(name, servingSize, brand);
                break;

            case "water":
                drink = new Water(name, servingSize, brand);
                break;

            case "alcohol":
                drink = new Alcohol(name, servingSize, brand);
                break;

            default: throw new ArgumentException($"Invalid drink type {type}!");
            }

            this.drinks.Add(drink);
            return($"Added {drink.Name} ({drink.Brand}) to the drink pool");
        }
コード例 #10
0
        public decimal CalculateTax(Alcohol alcohol)
        {
            var alcoholTax = alcohol.Price * 1.3m;
            var calcoholTotalPriceWithDiscount = CalculateTotalPrice(alcoholTax, alcohol);

            return(calcoholTotalPriceWithDiscount);
        }
コード例 #11
0
        public UserSettings setAlcohol(Alcohol alcohol)
        {
            switch (alcohol)
            {
            case Alcohol.NEGATIVE:
            {
                                        #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
                getInstance().setAlcohol(1);
                                        #endif
                return(this);
            }

            case Alcohol.NEUTRAL:
            {
                                        #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
                getInstance().setAlcohol(2);
                                        #endif
                return(this);
            }

            case Alcohol.POSITIVE:
            {
                                        #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
                getInstance().setAlcohol(3);
                                        #endif
                return(this);
            }
            }
            return(null);
        }
コード例 #12
0
        public string AddDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink = null;

            switch (type)
            {
            case "Alcohol":
                drink = new Alcohol(name, servingSize, brand);
                break;

            case "FuzzyDrink":
                drink = new FuzzyDrink(name, servingSize, brand);
                break;

            case "Juice":
                drink = new Juice(name, servingSize, brand);
                break;

            case "Water":
                drink = new Water(name, servingSize, brand);
                break;
            }

            this.drinks.Add(drink);

            return($"Added {name} ({brand}) to the drink pool");
        }
コード例 #13
0
        /// <inheritdoc />
        public Consumable Convert(ItemDTO value, object state)
        {
            var entity = new Alcohol();

            this.Merge(entity, value, state);
            return(entity);
        }
コード例 #14
0
 void OnTriggerStay2D(Collider2D other)
 {
     if (other.tag.Contains("Pickable") && !m_currentlyCollidingWith)
     {
         //Debug.Log("collided with " + other.tag + " " + other.gameObject.name);
         Debug.Log("TES");
         m_currentlyCollidingWith = other;
         GameObject go = other.gameObject;
         Glass      g  = go.GetComponent <Glass>();
         if (g)
         {
             g.setSelected(true);
         }
         Alcohol a = go.GetComponent <Alcohol>();
         if (a)
         {
             a.setSelected(true);
         }
         Fruit f = go.GetComponent <Fruit>();
         if (f)
         {
             f.setSelected(true);
         }
     }
     else if (other.tag.Contains("Client") && !m_client)
     {
         m_client = other.gameObject;
     }
 }
コード例 #15
0
ファイル: DrinkFactory.cs プロジェクト: astanchev/CSharp-OOP
        public IDrink CreateDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink;

            if (type == "FuzzyDrink")
            {
                drink = new FuzzyDrink(name, servingSize, brand);
            }
            else if (type == "Juice")
            {
                drink = new Juice(name, servingSize, brand);
            }
            else if (type == "Water")
            {
                drink = new Water(name, servingSize, brand);
            }
            else if (type == "Alcohol")
            {
                drink = new Alcohol(name, servingSize, brand);
            }
            else
            {
                throw new InvalidOperationException("Wrong type of drink!");
            }

            return(drink);
        }
コード例 #16
0
        // GET: Alcohol/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                TempData["mensaje"] = "Especifique la condición.";
                return(RedirectToAction("Index"));
            }
            Alcohol alcohol = db.Alcohol.Find(id);

            if (alcohol != null)
            {
                if (alcohol.activo == 1)
                {
                    alcohol.estado_String = "Activo";
                }
                else
                {
                    alcohol.estado_String = "Inactivo";
                }
            }
            if (alcohol == null)
            {
                TempData["mensaje"] = "La condición no éxiste.";
                return(RedirectToAction("Index"));
            }
            return(View(alcohol));
        }
コード例 #17
0
ファイル: GameManager.cs プロジェクト: keving9871/I-msorry
    // Use this for initialization
    void Start()
    {
        //Prostitute(Sprite sprite, string name, int preference, highlighted)
        Prostitute Bertha  = new Prostitute(Berthas, 1, false);
        Prostitute Amalia  = new Prostitute(Amalias, 2, false);
        Prostitute Eleanor = new Prostitute(Eleanors, 3, false);
        Prostitute Fannie  = new Prostitute(Fannies, 4, false);
        Prostitute Mollie  = new Prostitute(Mollies, 5, false);
        Prostitute Pearl   = new Prostitute(Pearls, 6, false);
        Prostitute Ai      = new Prostitute(Ais, 7, false);


        Prostitutes = new Prostitute[8];

        Prostitutes[1] = Bertha;
        Prostitutes[2] = Amalia;
        Prostitutes[3] = Eleanor;
        Prostitutes[4] = Fannie;
        Prostitutes[5] = Mollie;
        Prostitutes[6] = Pearl;
        Prostitutes[7] = Ai;

        Prostitutes[1].killed = true;
        Prostitutes[2].killed = true;
        Prostitutes[3].killed = true;
        Prostitutes[4].killed = true;
        Prostitutes[5].killed = true;
        Prostitutes[6].killed = true;


        //Alcohol(Sprite sprite, string name, int preference, served, highlighted)
        Alcohol Bottle    = new Alcohol(Bottles, 1, false, false);
        Alcohol Shot      = new Alcohol(Shots, 2, false, false);
        Alcohol Glass     = new Alcohol(Glasss, 3, false, false);
        Alcohol BottleFat = new Alcohol(BottleFats, 4, false, false);

        Alcohols = new Alcohol[5];

        Alcohols[1] = Bottle;
        Alcohols[2] = Shot;
        Alcohols[3] = Glass;
        Alcohols[4] = BottleFat;

        //public Food(GameObject Prefab_, int preference, bool served_, bool highlighted_)
        Food Steak   = new Food(Steaks, 1, false, false);
        Food BB      = new Food(BBs, 2, false, false);
        Food BG      = new Food(BGs, 3, false, false);
        Food Chicken = new Food(Chickens, 4, false, false);

        Foods = new Food[5];

        Foods[1] = Steak;
        Foods[2] = BB;
        Foods[3] = BG;
        Foods[4] = Chicken;

        DontDestroyOnLoad(this.gameObject);
        Killed();
    }
コード例 #18
0
        private void AddAlcoholIfMathced(Alcohol alcohol)
        {
            double percentege = totalAlcoholVolume - CalculateSingleAlchol(alcohol);

            if (percentege > 0)
            {
                totalAlcoholVolume = percentege;
                matchedAlcohol.Add(alcohol);
            }
        }
コード例 #19
0
        public void Calculate()
        {
            List <Alcohol> alcohols = Logistics.GetAlcoholsList();
            Alcohol        alcoholWithMinPercentage = GetAlcoholFromListWithMinPercentage(alcohols);

            while (totalAlcoholVolume > CalculateSingleAlchol(alcoholWithMinPercentage))
            {
                AddMatchedAlcohols(alcohols);
            }
            matchedAlcohol = matchedAlcohol.OrderBy(a => a.AlcoholPercent).ToList();
        }
コード例 #20
0
 public override void Interact()
 {
     if (PlayerScan.instance.progressStatus == ProgressStatus.E_GetCashNCard)        //카드를 가진상태면
     {
         PlayerScan.instance.progressStatus = ProgressStatus.E_GetAlcholBottle;      //술을 가진 상태로 변경
         Alcohol alcohol = ObjectManager.GetObject <Alcohol>();
         alcohol.gameObject.SetActive(true);
         Inventory.instance.GetItemInSlot(alcohol.gameObject);                  //술을 가져오고
         StartCoroutine(GetItemPanel.instance.IShowText(alcohol.itemName));     //술을 얻었다 표시!
     }
 }
コード例 #21
0
ファイル: HomeController.cs プロジェクト: shutlone/Web_stuff
 public ActionResult Add(Alcohol alc)
 {
     if (db.Alcohols.Contains(alc))
     {
         return(BadRequest());
     }
     alc.CreationDate = DateTime.Now;
     db.Alcohols.Add(alc);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #22
0
        //Add
        public void Add(AlcoholDTO alcoholDTO)
        {
            var alcohol = new Alcohol
            {
                ABV   = alcoholDTO.ABV,
                Brand = alcoholDTO.Brand,
                Style = alcoholDTO.Style,
                Type  = alcoholDTO.Type
            };

            _repo.Add(alcohol);
        }
コード例 #23
0
 private MatchedAlcohol MapAlcoholWithMathcedAlcohol(Alcohol alcohol)
 {
     return(new MatchedAlcohol
     {
         Id = alcohol.Id,
         NameAlcohol = alcohol.NameAlcohol,
         AlcoholPercent = alcohol.AlcoholPercent,
         Volume = alcohol.Volume,
         Discription = alcohol.Discription,
         PathImage = alcohol.PathImage
     });
 }
コード例 #24
0
 public ActionResult Post(AlcoholModel model)
 {
     try
     {
         Alcohol result = _repository.Add(model);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, "Failed database"));
     }
 }
コード例 #25
0
 public ActionResult Edit(Alcohol alcohol)
 {
     try
     {
         db.Entry(alcohol).State = EntityState.Modified;
         db.SaveChanges();
         TempData["mensaje"] = "Atualizado con éxito.";
         return(RedirectToAction("Index"));
     }
     catch
     {
         ViewBag.ID_EXPEDIENTE = new SelectList(db.Expediente, "id", "ID_PACIENTE", alcohol.ID_EXPEDIENTE);
         return(View(alcohol));
     }
 }
コード例 #26
0
ファイル: OrderShit.cs プロジェクト: keving9871/I-msorry
 public void GiveDrink(Alcohol drink)
 {
     if (drink.forpreference == currentcustomer.Drinkpreference)
     {
         Destroy(drink.drinkmade);
         drink.served = false;
         Debug.Log("drinkgone");
         Invoke("OrderFood", 5f);
         COS.Stop();
     }
     else
     {
         Debug.Log("delse");
     }
 }
 public void ParseAlcoholString(string input)
 {
     switch (input)
     {
         case "No_Alcohol_Served": 
             this.Alcohol = Model.Alcohol.No_Alcohol_Served;
             break;
         case "Wine_Beer":
             this.Alcohol = Model.Alcohol.Wine_Beer;
             break;
         case "Full_Bar":
             this.Alcohol = Model.Alcohol.Full_Bar;
             break;
     }
 }
コード例 #28
0
        public ActionResult DeleteConfirmed(int id)
        {
            Alcohol alcohol = db.Alcohol.Find(id);

            if (alcohol.activo == 0)
            {
                alcohol.activo = 1;
            }
            else
            {
                alcohol.activo = 0;
            }
            db.SaveChanges();
            TempData["mensaje"] = "Estado actualizado.";
            return(RedirectToAction("Index"));
        }
コード例 #29
0
 public ActionResult Create(Alcohol alcohol)
 {
     try
     {
         alcohol.activo = 1;
         db.Alcohol.Add(alcohol);
         db.SaveChanges();
         TempData["mensaje"] = "Guardado con éxito.";
         return(RedirectToAction("Index"));
     }
     catch
     {
         ViewBag.ID_EXPEDIENTE = new SelectList(db.Expediente, "id", "ID_PACIENTE", alcohol.ID_EXPEDIENTE);
         return(View(alcohol));
     }
 }
コード例 #30
0
        public Alcohol Add(AlcoholModel model)
        {
            Alcohol alcohol = new Alcohol
            {
                Name            = model.Model_Name,
                Alcohol_type    = model.Model_Alcohol_type,
                Alcohol_degree  = model.Model_Alcohol_degree,
                Pulled_from     = model.Model_Pulled_from,
                Year_of_alcohol = model.Model_Year_of_alcohol,
                Made_In         = model.Model_Made_In
            };

            _context.Add(alcohol);
            _context.SaveChanges();

            return(alcohol);
        }
コード例 #31
0
 public override void OnEnter(int playerID)
 {
     Globals.gameHandler.GetPlayerFromID(playerID).AddDebt(Balance.PartyCost);
     do
     {
         Card c;
         if (Globals.r.Next(2) == 0)
         {
             c = new Drugs(Vector2.Zero, true, playerID);
         }
         else
         {
             c = new Alcohol(Vector2.Zero, true, playerID);
         }
         Globals.cardSelected = c;
         Globals.gameHandler.gameBoard.PlayCardOnField(playerID, playerID == 0 ? Globals.gameHandler.gameBoard.playingField1 : Globals.gameHandler.gameBoard.playingField2);
         Globals.cardSelected = null;
     } while (Globals.r.NextDouble() < Balance.PartyChance);
 }
コード例 #32
0
ファイル: Appodeal.cs プロジェクト: tobynextdoor/Rocket-Wars
 public UserSettings setAlcohol(Alcohol alcohol)
 {
     switch(alcohol) {
         case Alcohol.NEGATIVE:
         {
             #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
             getInstance().setAlcohol(1);
             #endif
             return this;
         }
         case Alcohol.NEUTRAL:
         {
             #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
             getInstance().setAlcohol(2);
             #endif
             return this;
         }
         case Alcohol.POSITIVE:
         {
             #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
             getInstance().setAlcohol(3);
             #endif
             return this;
         }
     }
     return null;
 }