public async Task <IActionResult> PutPowder(int id, Powder powder) { if (id != powder.Id) { return(BadRequest()); } _context.Entry(powder).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PowderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Neighbors(ref NativeHashMap <int, int> positions, Powder p, int index) { this.p = p; this.index = index; this.positions = positions; top = topLeft = topRight = left = right = bottomRight = bottomLeft = bottom = -2; }
void Steam(ref Powder p, ref Neighbors n) { if (!n.TopEmpty() && powders[n.Top()].type == PowderTypes.Stone) { ChangeElement(n.index, PowderTypes.Water); } }
// Tømmer alt indhold public string Empty() { filter = null; powder = null; return("The machine is now empty"); }
public ActionResult EditPowders(ICollection <MenuItem> powders) { Models.Customer customer = GetLoggedInCustomer(); Models.OrderItem orderItem = GetOrderItem(customer.CurrentOrderItemId); List <Powder> powderList = new List <Powder>(); for (int i = 0; i < powders.Count(); i++) { MenuItem setPowder = powders.ElementAt(i); if (setPowder.Quantity == null) { setPowder.Quantity = 0; } Powder newPowder = new Powder(); newPowder.PowderType = setPowder.Name; newPowder.Scoops = setPowder.Quantity; newPowder.OrderItemId = orderItem.OrderItemId; newPowder.Price = (setPowder.Price * setPowder.Quantity); powderList.Add(null); powderList[i] = new Powder(); powderList[i].PowderType = newPowder.PowderType; powderList[i].Scoops = newPowder.Scoops; powderList[i].OrderItemId = newPowder.OrderItemId; powderList[i].Price = newPowder.Price; db.SaveChanges(); } orderItem.Powders = powderList; db.SaveChanges(); return(RedirectToAction("ReviewOrder", new { id = orderItem.OrderItemId })); }
public void renamePowder(int id, string newName) { Powder powder = new Powder(id, newName); powderRepository.save(powder); PowdersUpdated(); }
public async Task <ActionResult <Powder> > PostPowder(Powder powder) { _context.Powder.Add(powder); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPowder", new { id = powder.Id }, powder)); }
/// <summary> /// 粉ものの投入処理 /// </summary> /// <param name="powder"></param> private void ThrowIn(Powder powder) { //contentsID.Enqueue(powder.type); contentsID.Add(powder.type); //見かけを変える処理 //以下に記述 }
public void testConstructor() { Powder powder = new Powder(1, "a"); Assert.AreEqual(1, powder.Id); Assert.AreEqual("a", powder.PowderName); Assert.IsFalse(-1 == powder.Id); }
void Lava(ref Powder p, ref Neighbors n) { if (!n.BottomEmpty() && powders[n.Bottom()].type != PowderTypes.Fire && powders[n.Bottom()].type != PowderTypes.Lava && powders[n.Bottom()].type != PowderTypes.Stone ) { PowderSystemUtils.SchdeduleRemovePowder(ref toDeleteEntities, n.Bottom()); } }
public void testDelete() { repository.deleteAll(); repository.delete(null); Powder powder = new Powder("test"); repository.save(powder); repository.delete(powder); Assert.AreEqual(0, repository.count()); }
public override void GetDataFromComponents(CosmeticProduct currentProduct, Control.ControlCollection controls) { base.GetDataFromComponents(currentProduct, controls); Control[] controlList = GetComponentsForInput(controls); Powder currentPowder = (Powder)currentProduct; ComboBox temp = (ComboBox)controlList[powderPackageTypeIndex]; currentPowder.Package = (Powder.TypeOfPackage)Enum.Parse(typeof(Powder.TypeOfPackage), temp.SelectedValue.ToString()); CheckBox tempCheckBox = (CheckBox)controlList[talcIndex]; currentPowder.isContainTalc = tempCheckBox.Checked; }
//============================================================================* // Export() //============================================================================* public void Export(cRWXMLDocument XMLDocument, XmlElement XMLParentElement, bool fIncludeTransactions = true) { if (Count > 0) { XmlElement XMLElement = XMLDocument.CreateElement(ExportName); XMLParentElement.AppendChild(XMLElement); foreach (cPowder Powder in this) { Powder.Export(XMLDocument, XMLElement, false, fIncludeTransactions); } } }
void SendFireworks(GameObject instance, Charge charge, Powder powder) { float diff = Random.Range(-5.0f, 5.0f); instance.transform.position = new Vector3(instance.transform.position.x + diff, instance.transform.position.y, instance.transform.position.z); var particleSystem = instance.GetComponent <ParticleSystem> (); var handleExplosion = particleSystem.GetComponent <HandleExplosion> (); handleExplosion.activateSceneTransition = false; handleExplosion.charge = charge; handleExplosion.powder = powder; StartCoroutine(Emit(particleSystem)); }
private void AddPowder() { if (frmPowder.IsOpen) { System.Windows.MessageBox.Show("An instance of the add powder window is currently open."); return; } _SelectedPowder = new Powder(); _frmPowder = new frmPowder(); _frmPowder.DataContext = this; _frmPowder.ResizeMode = System.Windows.ResizeMode.NoResize; _frmPowder.Show(); }
public ActionResult Create([Bind(Include = "Id,Name,ManufacturerId,PowderTypeId,PowderShapeId,Notes")] Powder modEntity) { if (ModelState.IsValid) { this.service.Add(modEntity); return(RedirectToAction("Index")); } ViewBag.MaufacturerId = new SelectList(this.manufacturers, "Id", "Name", modEntity.ManufacturerId); ViewBag.PowderShapeId = new SelectList(this.powderShapes, "Id", "Name", modEntity.PowderShapeId); ViewBag.PowderTypeId = new SelectList(this.powderTypes, "Id", "Name", modEntity.PowderTypeId); return(View(modEntity)); }
public static void Spawn(ref EntityCommandBuffer.Concurrent cmdBuffer, Powder p) { // Debug.Log("Spawn: " + x + ", " + y); cmdBuffer.CreateEntity(PowderGame.powderArchetype); cmdBuffer.SetComponent(p); cmdBuffer.SetComponent(new Position2D { Value = CoordToWorld(p.coord.x, p.coord.y) }); cmdBuffer.SetComponent(new Heading2D { Value = new float2(0.0f, 1.0f) }); cmdBuffer.AddSharedComponent(PowderTypes.values[p.type].renderer); powderCount++; }
void Fire(ref Powder p, ref Neighbors n) { if (!n.TopEmpty()) { if (powders[n.Top()].type == PowderTypes.Wood) { ChangeElement(n.Top(), rand.Chance(2) ? PowderTypes.Fire : PowderTypes.Steam); } else if (powders[n.Top()].type == PowderTypes.Sand) { ChangeElement(n.Top(), PowderTypes.Glass); } } }
//============================================================================* // ProcessPowders() //============================================================================* public void ProcessPowders() { m_nNumBadPowders = 0; foreach (cPowder Powder in m_DataFiles.PowderList) { if (!Powder.Validate()) { m_nNumBadPowders++; } ProcessTransactionList(Powder); } }
void Water(ref Powder p, ref Neighbors n) { if (!n.BottomEmpty()) { if (powders[n.Bottom()].type == PowderTypes.Fire || powders[n.Bottom()].type == PowderTypes.Steam) { PowderSystemUtils.SchdeduleRemovePowder(ref toDeleteEntities, n.Bottom()); } else if (powders[n.Bottom()].type == PowderTypes.Lava) { ChangeElement(n.index, PowderTypes.Steam); } } }
void Acid(ref Powder p, ref Neighbors n) { if (!n.LeftEmpty()) { AcidTouch(n.Left()); } if (!n.RightEmpty()) { AcidTouch(n.Right()); } if (!n.BottomEmpty()) { AcidTouch(n.Bottom()); } }
public override void LoadDataToComponets(CosmeticProduct currentProduct, Control.ControlCollection controls) { base.LoadDataToComponets(currentProduct, controls); Control[] controlList = GetComponentsForInput(controls); Powder currentPowder = (Powder)currentProduct; ComboBox tempComboBox = (ComboBox)controlList[powderPackageTypeIndex]; tempComboBox.SelectedValue = Enum.GetName(typeof(Powder.TypeOfPackage), currentPowder.Package); CheckBox temp = (CheckBox)controlList[talcIndex]; temp.Checked = currentPowder.isContainTalc; }
private static void DecoratorDosa() { IDosa plainDosa = new PlainDosa(); //Console.WriteLine("Description : {0} - Price {1}", plainDosa.GetDescription(), plainDosa.GetPrice()); Ghee ghee = new Ghee(plainDosa); Onion onion = new Onion(ghee); Console.WriteLine("Description : {0} - Total Price : Rs. {1}", onion.GetDescription(), onion.GetPrice()); Powder powder = new Powder(onion); Console.WriteLine("Description : {0} - Total Price : Rs. {1}", powder.GetDescription(), powder.GetPrice()); }
Powder Simulate(Powder p, int index) { if (p.life == 0 || p.coord.x < 0 || p.coord.x > PowderGame.width || p.coord.y < 0 || p.coord.y > PowderGame.height) { PowderSystemUtils.SchdeduleRemovePowder(ref toDeleteEntities, index); return(p); } if (p.life != -1) { p.life--; } var n = new Neighbors(ref hashMap, p, index); SimulateState(ref p, ref n); switch (p.type) { case PowderTypes.Acid: Acid(ref p, ref n); break; case PowderTypes.Fire: Fire(ref p, ref n); break; case PowderTypes.Steam: Steam(ref p, ref n); break; case PowderTypes.Water: Water(ref p, ref n); break; case PowderTypes.Lava: Lava(ref p, ref n); break; default: if (PowderTypes.values[p.type].IsGenerator()) { Generate(ref p, ref n); } break; } return(p); }
// Fylder beholderen op med det pulver den har fået i sin parameter public string Fill(Powder powder) { if (HasFilter() && !HasPowder()) { this.powder = powder; return("Powder is filled"); } else if (!HasFilter()) { return("The machine has no Filter"); } else { return("The Machine is not Empty"); } }
public Powder ConvertPowderToDTO(BllPowder bllPowder) { Powder dTOPowder = new Powder() { Id = bllPowder.Id, Name = bllPowder.Name, Brand = bllPowder.Brand, Price = bllPowder.Price, Volume = bllPowder.Volume, QuantityBottles = bllPowder.QuantityBottles, QuantityGeneralVolume = bllPowder.QuantityGeneralVolume, Color = bllPowder.Color, QuntityCount = bllPowder.QuntityCount }; return(dTOPowder); }
public BllPowder ConvertPowderToBll(Powder dTOPowder) { BllPowder bllPowder = new BllPowder() { Id = dTOPowder.Id, Name = dTOPowder.Name, Brand = dTOPowder.Brand, Price = dTOPowder.Price, Volume = dTOPowder.Volume, QuantityBottles = dTOPowder.QuantityBottles, QuantityGeneralVolume = dTOPowder.QuantityGeneralVolume, Color = dTOPowder.Color, QuntityCount = dTOPowder.QuntityCount }; return(bllPowder); }
public void doPowder(Color[] colors, Powder powder, VectorInt3 min, VectorInt3 max) { VectorInt3 mi = min + this._offset; //VectorInt3 mx = max + this._offset; foreach (VoxelFace.Rect r in powder.rect) { for (int x = r.min.x; x < r.max.x; ++x) { for (int y = r.min.y; y < r.max.y; ++y) { for (int z = r.min.z; z < r.max.z; ++z) { VoxelHandler handler = _mesh.getVoxel(new VectorInt3(x, y, z) + mi); // Debug.Log ("x" + x + "y" +y +"z" + z); if (handler != null) { foreach (VectorInt4 vertice in handler.vertices) { colors[vertice.x] = r.color; colors[vertice.y] = r.color; colors[vertice.z] = r.color; colors[vertice.w] = r.color; } } } } } } foreach (VoxelFace.Point p in powder.point) { VoxelHandler handler = _mesh.getVoxel(p.position + mi); if (handler != null) { foreach (VectorInt4 vertice in handler.vertices) { colors[vertice.x] = p.color; colors[vertice.y] = p.color; colors[vertice.z] = p.color; colors[vertice.w] = p.color; } } } }
void Generate(ref Powder p, ref Neighbors n) { var generatedType = PowderTypes.values[p.type].generatedElementType; if (PowderTypes.values[generatedType].state == PowderState.Liquid || PowderTypes.values[generatedType].state == PowderState.Powder) { if (n.TopEmpty()) { var generatedPowder = PowderTypes.values[generatedType].creator(new Vector2Int(p.coord.x, p.coord.y - 1)); PowderGame.Spawn(ref cmdBuffer, generatedPowder); } } else if (n.BottomEmpty()) { var generatedPowder = PowderTypes.values[generatedType].creator(new Vector2Int(p.coord.x, p.coord.y + 1)); PowderGame.Spawn(ref cmdBuffer, generatedPowder); } }
public RocketLayout(Powder powder, Charge charge, params RocketComponent[] components) { this.powder = powder; this.charge = charge; for (int i = 0; i < components.Length; i++) { RocketComponent comp = components[i]; if (typeof(Powder) == comp.GetType()) { this.powder = (Powder)comp; } else { this.charge = (Charge)comp; } } }
public void assemble(Bullet b, Powder p, Shell s) { bullet = b; powder = p; shell = s; }
public void doPowder(Powder powder, VectorInt3 min, VectorInt3 max) { Color[] colors = this.beginEmotions(); doPowder (colors, powder, min, max); this.endEmotions (colors); }
public void doPowder(Color[] colors, Powder powder, VectorInt3 min, VectorInt3 max) { VectorInt3 mi = min + this._offset; //VectorInt3 mx = max + this._offset; foreach (VoxelFace.Rect r in powder.rect) { for (int x = r.min.x; x<r.max.x; ++x) { for(int y = r.min.y; y< r.max.y; ++y){ for(int z = r.min.z;z<r.max.z; ++z ){ VoxelHandler handler = _mesh.getVoxel(new VectorInt3(x, y, z) + mi); // Debug.Log ("x" + x + "y" +y +"z" + z); if(handler != null){ foreach(VectorInt4 vertice in handler.vertices){ colors[vertice.x] = r.color; colors[vertice.y] = r.color; colors[vertice.z] = r.color; colors[vertice.w] = r.color; } } } } } } foreach (VoxelFace.Point p in powder.point) { VoxelHandler handler = _mesh.getVoxel(p.position + mi); if(handler != null){ foreach(VectorInt4 vertice in handler.vertices){ colors[vertice.x] = p.color; colors[vertice.y] = p.color; colors[vertice.z] = p.color; colors[vertice.w] = p.color; } } } }