예제 #1
0
 private void FlavorCheckedChanged(object sender, EventArgs e)
 {
     foreach (Control control in this.Flavor.Controls)
     {
         if (control is RadioButton)
         {
             RadioButton radio = control as RadioButton;
             if (radio.Checked)
             {
                 switch (radio.Name.ToLowerInvariant())
                 {
                     //case "avx":
                     //    flavor = Flavors.AVX;
                     //    break;
                     //case "avx2":
                     //    flavor = Flavors.AVX2;
                     //    break;
                     //case "avx512":
                     //    flavor = Flavors.AVX512;
                     //    break;
                     case "cuda":
                     case "csharp":
                     default:
                         flavor = Flavors.CUDA;
                         break;
                   
                         //flavor = Flavors.Source;
                         //break;
                 }
                 render();
             }
         }
     }
 }
예제 #2
0
        private void RadioButtonCheckedChanged(object sender, EventArgs e)
        {
            foreach (Control control in this.Renderer.Controls)
            {
                if (control is RadioButton)
                {
                    RadioButton radio = control as RadioButton;
                    if (radio.Checked)
                    {
                        switch (radio.Name)
                        {
                        case "CpuSeqRadBut":
                            flavor = Flavors.CPUseq;
                            break;

                        case "CPUParRadBut":
                            flavor = Flavors.CPUpar;
                            break;

                        default:
                            flavor = Flavors.CPUseq;
                            break;
                        }
                    }
                }
            }
        }
예제 #3
0
    void AddToHand()
    {
        currentItem = inventory[cannonIndex][0];
        inventory[cannonIndex].Remove(currentItem);

        if (inventory[cannonIndex].Count == 0)
        {
            inventory.Remove(inventory[cannonIndex]);
            UpdateCounter(0, false);
        }
        if (currentItem.GetComponent <Gelato>() != null)
        {
            currentItem.transform.SetParent(transform.parent);
            currentItem.transform.localPosition = new Vector3(0, 0, 0.5f);

            Flavors flav = currentItem.GetComponent <Gelato>().flavor;

            if (!inHand.ContainsKey(flav))
            {
                inHand.Add(flav, 1);
            }
            else
            {
                inHand[flav]++;
            }

            toGive.Add(currentItem);

            CharacterManager.Instance.pData.gelato_inventory[currentFlav]--;
        }

        holding = true;
    }
예제 #4
0
 public void Init(int flavorIndex)
 {
     image                   = GetComponent <Image>();
     image.sprite            = iceCreamSprites[flavorIndex];
     flavor                  = (Flavors)flavorIndex;
     transform.position      = Vector3.zero;
     transform.localPosition = Vector3.zero;
 }
예제 #5
0
 public Sprite GetFlavorSmallIcon(Flavors p_flavor)
 {
     if (m_flavorSmallIconsDict.ContainsKey(p_flavor))
     {
         return(m_flavorSmallIconsDict[p_flavor]);
     }
     return(null);
 }
예제 #6
0
        public async Task <ActionResult> Create(Flavors flavors)
        {
            var userId      = this.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
            var currentUser = await _userManager.FindByIdAsync(userId);

            flavors.User = currentUser;
            _db.Flavors.Add(flavors);
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public IActionResult UpdateFlavorAvailability([FromBody] Flavors flavor)
        {
            bool result = false;

            if (cakeOptionsDao.UpdateFlavorAvailability(flavor))
            {
                result = true;
            }
            return(Ok(result));
        }
        public IActionResult Create([FromBody] Flavors flavor)
        {
            bool result = false;

            if (cakeOptionsDao.AddFlavorOption(flavor))
            {
                result = true;
            }
            return(Ok(result));
        }
예제 #9
0
        public void AddFlavor(Ruleset flavor)
        {
            if (Flavors.Contains(flavor))
            {
                return;
            }

            Flavors.Add(flavor);
            Options.Or(flavor.Options);
        }
예제 #10
0
        public void RemoveFlavor(Ruleset flavor)
        {
            if (!Flavors.Contains(flavor))
            {
                return;
            }

            Flavors.Remove(flavor);
            Options.And(flavor.Options.Not());
            flavor.Options.Not();
        }
예제 #11
0
 public ActionResult AddTreat(Flavors flavor, int TreatsId)
 {
     if (TreatsId != 0)
     {
         _db.TreatsFlavors.Add(new TreatsFlavors()
         {
             TreatsId = TreatsId, FlavorsId = flavor.FlavorsId
         });
     }
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #12
0
 public ActionResult Edit(Flavors flavor, int TreatsId)
 {
     if (TreatsId != 0)
     {
         _db.TreatsFlavors.Add(new TreatsFlavors()
         {
             TreatsId = TreatsId, FlavorsId = flavor.FlavorsId
         });
     }
     _db.Entry(flavor).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #13
0
        public async Task <ActionResult> Create(Flavors flavor, int TreatsId)
        {
            var userId      = this.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
            var currentUser = await _userManager.FindByIdAsync(userId);

            flavor.User = currentUser;
            _db.Flavors.Add(flavor);
            if (TreatsId != 0)
            {
                _db.TreatsFlavors.Add(new TreatsFlavors()
                {
                    TreatsId = TreatsId, FlavorsId = flavor.FlavorsId
                });
            }
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        /// <summary>
        /// Following 3 methods are used for adding, updating, getting flavor options
        /// </summary>
        /// <param name="updatedFlavor"></param>
        /// <returns></returns>
        public bool UpdateFlavorAvailability(Flavors updatedFlavor)
        {
            try
            {
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();
                    SqlCommand cmd = new SqlCommand("UPDATE flavors SET available = @available WHERE id = @id;", conn);
                    cmd.Parameters.AddWithValue("@id", updatedFlavor.id);
                    cmd.Parameters.AddWithValue("@available", updatedFlavor.isAvailable);

                    cmd.ExecuteNonQuery();
                }
            }
            catch (SqlException ex)
            {
                return(false);
            }
            return(true);
        }
        public bool AddFlavorOption(Flavors newFlavor)
        {
            try
            {
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();
                    SqlCommand cmd = new SqlCommand("INSERT INTO flavors (available, flavor) VALUES (@available, @flavor);", conn);

                    cmd.Parameters.AddWithValue("@available", newFlavor.isAvailable);
                    cmd.Parameters.AddWithValue("@flavor", newFlavor.flavor);

                    cmd.ExecuteNonQuery();
                }
            }
            catch (SqlException ex)
            {
                return(false);
            }
            return(true);
        }
        public List <Flavors> GetAllCakeFlavors()
        {
            List <Flavors> listOfFlavors = new List <Flavors>();

            try
            {
                // Create a new connection object
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    // Open the connection
                    conn.Open();

                    string     sql = $"SELECT * FROM flavors";
                    SqlCommand cmd = new SqlCommand(sql, conn);

                    // Execute the command
                    SqlDataReader reader = cmd.ExecuteReader();

                    // Loop through each row
                    while (reader.Read())
                    {
                        Flavors flavor = new Flavors();
                        flavor.id          = Convert.ToInt32(reader["id"]);
                        flavor.flavor      = Convert.ToString(reader["flavor"]);
                        flavor.isAvailable = Convert.ToBoolean(reader["available"]);

                        listOfFlavors.Add(flavor);
                    }
                }
            }
            catch (SqlException ex)
            {
                throw;
            }

            return(listOfFlavors);
        }
예제 #17
0
 public ActionResult Create(Flavors flavors)
 {
     _db.Flavors.Add(flavors);
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #18
0
 //constructor
 public Gum(Flavors _flavor)
 {
     this.flavor = _flavor;
 }
예제 #19
0
파일: Runner.cs 프로젝트: afrog33k/Excess
        private KeyValuePair <string, LoaderFunc> loadExtension(string dll)
        {
            var assembly = Assembly.LoadFrom(dll);
            var name     = string.Empty;
            var loader   = Loader <RoslynCompiler> .CreateFrom(assembly, out name,
                                                               flavorFunction : ext => Flavors.ContainsKey(ext)
                                                               ?Flavors[ext]
                                                               : "Default");

            if (loader == null)
            {
                return(default(KeyValuePair <string, LoaderFunc>));
            }

            return(new KeyValuePair <string, LoaderFunc>(name, loader));
        }
예제 #20
0
 public ActionResult Edit(Flavors flavors)
 {
     _db.Entry(flavors).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }