Esempio n. 1
0
 public ShapeTestResult(bool didHit, int hitEntity, Vector3 hitPosition, Vector3 hitNormal, materials hitMaterial)
 {
     DidHit      = didHit;
     HitEntity   = hitEntity;
     HitPosition = hitPosition;
     HitNormal   = hitNormal;
     HitMaterial = hitMaterial;
 }
Esempio n. 2
0
        private void UpdateDebrisLayer(materials material)
        {
            if (Game.GameTime - _lastDebrisSpawnTime > 3000 + Probability.GetInteger(0, 5000))
            {
                //  UI.ShowSubtitle("spawn debris");

                new TDebris(this, _position, ScriptThread.GetVar <float>("vortexRadius"));
            }
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            materials materials = await db.materials.FindAsync(id);

            db.materials.Remove(materials);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public string getApplyServiceId(int materialId, int count)
        {
            materials material    = _entities.materials.Find(materialId);
            COUNT     c           = _entities.COUNT.Find(count);
            decimal?  resultPrice = material.price * c.COUNT_VALUE * c.PRICE;
            decimal   res         = Decimal.Round((decimal)resultPrice, 2);

            return("" + res);
        }
Esempio n. 5
0
 public sculpting(int chunkSize, int voxelsPerChunk, int overlap, float max, materials mats)
 {
     this.chunkSize      = chunkSize;
     this.voxelsPerChunk = voxelsPerChunk;
     this.overlap        = overlap;
     this.resolution     = (float)voxelsPerChunk / chunkSize;
     this.cS             = (int)((float)chunkSize * resolution) + overlap;
     this.max            = max;
     this.materials      = mats;
 }
 public materials this[materials m]
 {
     get
     {
         if (Materials.Any(l => l == m))
         {
             return(Materials.First(l => l == m));
         }
         return(materials.none);
     }
 }
        public async Task <ActionResult> Edit([Bind(Include = "Id,description,price,count")] materials materials)
        {
            if (ModelState.IsValid)
            {
                db.Entry(materials).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(materials));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,description,price,count")] materials materials)
        {
            if (ModelState.IsValid)
            {
                db.materials.Add(materials);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(materials));
        }
 public bool AddNewMaterial(materials materials)
 {
     try
     {
         _entities.materials.Add(materials);
         _entities.SaveChanges();
     }
     catch
     {
         return(false);
     }
     return(true);
 }
        // GET: materials/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            materials materials = await db.materials.FindAsync(id);

            if (materials == null)
            {
                return(HttpNotFound());
            }
            return(View(materials));
        }
Esempio n. 11
0
        private void UpdateSurfaceDetection(int gameTime)
        {
            if (gameTime - lastParticleShapeTestTime > 1200)
            {
                var str = ShapeTestEx.RunShapeTest(_position + Vector3.WorldUp * 10.0f,
                                                   _position + Vector3.WorldDown * 10.0f, null, IntersectOptions.Everything);

                if (str.HitMaterial != lastMaterialTraversed)
                {
                    switch (lastMaterialTraversed)
                    {
                    case materials.sand_track:
                    case materials.sand_compact:
                    case materials.sand_dry_deep:
                    case materials.sand_loose:
                    case materials.sand_wet:
                    case materials.sand_wet_deep:
                    {
                        particleColorPrev = particleColor;
                        particleColorGoal = Color.NavajoWhite;
                        particleLerpTime  = 0.0f;
                    }

                    break;

                    default:
                        particleColorPrev = particleColor;
                        particleColorGoal = Color.Black;
                        particleLerpTime  = 0.0f;
                        break;
                    }

                    lastMaterialTraversed = str.HitMaterial;
                }

                lastParticleShapeTestTime = gameTime;
            }

            if (particleLerpTime < 1.0f)
            {
                particleLerpTime += Game.LastFrameTime / ColorLerpDuration;
                particleColor     = particleColor.Lerp(particleColorGoal, particleLerpTime);
            }

            MemoryAccess.SetPtfxColor("core", "ent_amb_smoke_foundry", 0, particleColor);
            MemoryAccess.SetPtfxColor("core", "ent_amb_smoke_foundry", 1, particleColor);
            MemoryAccess.SetPtfxColor("core", "ent_amb_smoke_foundry", 2, particleColor);
        }
Esempio n. 12
0
        private void AddNewItem_Click(object sender, EventArgs e)
        {
            categories category = categoriesComboBox.SelectedItem as categories;
            materials zeroIdObj = materialsBindingSource.List.OfType<materials>().ToList().Find(f => f.material_id == 0);
            if (zeroIdObj != null) return;

            this.splitContainer1.SplitterDistance = 120;

            materials obj = new materials
            {
                unit_id = 1,
                category_id = category.category_id
            };

            materialsBindingSource.Add(obj);
            this.material_nameTextBox.Focus();
            materialsBindingSource.MoveLast();

            this.buttonAddNew.Enabled = false;
        }
 public void copyProtectiveHazard(ProtectiveHazard original)
 {
     name               = original.name;
     material           = original.material;
     protectiveHazardHP = original.protectiveHazardHP;
 }
 public ProtectiveHazard(ProtectiveHazard protectiveHazard)
 {
     name               = protectiveHazard.name;
     material           = protectiveHazard.material;
     protectiveHazardHP = protectiveHazard.protectiveHazardHP;
 }
 public ProtectiveHazard(string name, materials material, int protectiveHazardHP)
 {
     this.name               = name;
     this.material           = material;
     this.protectiveHazardHP = protectiveHazardHP;
 }