public Hardness SwitchHardness(int index) { var hardness = new Hardness(); switch (index) { case 1: hardness.projectionMode = JointProjectionMode.PositionAndRotation; hardness.projectionAngle = 0.5f; break; case 2: hardness.projectionMode = JointProjectionMode.PositionAndRotation; hardness.projectionAngle = 0; break; case 3: hardness.projectionMode = JointProjectionMode.PositionAndRotation; hardness.projectionAngle = 10f; hardness.projectionDistance = 5; break; case 4: hardness.projectionMode = JointProjectionMode.PositionAndRotation; hardness.projectionAngle = 5f; hardness.projectionDistance = 2.5f; break; case 5: hardness.projectionMode = JointProjectionMode.PositionAndRotation; hardness.projectionAngle = 0f; hardness.projectionDistance = 0; break; default: hardness.projectionMode = JointProjectionMode.None; break; } return(hardness); }
public void Delete(int HardnessID) { Hardness _dbEntry = _context.Hardnesses.Find(HardnessID); _dbEntry.Enabled = false; _context.SaveChanges(); }
public override void _Ready() { _sprite = GetNode <Sprite>("Sprite"); _hardness = GetRandomHardness(); SetHardnessTint(_hardness); }
public Pencil(String bodyColor, String drawingColor, Double length, Hardness hardness, Type type, Material material) { if (bodyColor == String.Empty || bodyColor == null) { throw new ArgumentException("String is empty or is not initialized", nameof(bodyColor)); } if (drawingColor == String.Empty || drawingColor == null) { throw new ArgumentException("String is empty or is not initialized", nameof(drawingColor)); } if (length < 1.0d) { throw new ArgumentException("Length of pencil cannot be < 1", nameof(drawingColor)); } if (hardness == Hardness.not_defined) { throw new ArgumentException("Hardness is not defined", nameof(drawingColor)); } if (type == Type.not_defined) { throw new ArgumentException("Type is not defined", nameof(drawingColor)); } if (material == Material.not_defined) { throw new ArgumentException("Material is not defined", nameof(drawingColor)); } this.bodyColor = bodyColor; this.drawingColor = drawingColor; this.length = length; this.hardness = hardness; this.type = type; this.material = material; }
public Pencil() { bodyColor = null; drawingColor = null; length = default; hardness = Hardness.not_defined; type = Type.not_defined; material = Material.not_defined; }
public override int GetHashCode() { int hashCode = -228455935; hashCode = hashCode * -1521134295 + Seed.GetHashCode(); hashCode = hashCode * -1521134295 + Magnitude.GetHashCode(); hashCode = hashCode * -1521134295 + Hardness.GetHashCode(); hashCode = hashCode * -1521134295 + Bias.GetHashCode(); return(hashCode); }
public static HardnessModel ToModel(this Hardness aHardnessEntity) { return(new HardnessModel() { HardnessId = aHardnessEntity.HardnessId, ShortName = aHardnessEntity.ShortName, Description = aHardnessEntity.Description, HardnessMin = aHardnessEntity.HardnessMin, HardnessMax = aHardnessEntity.HardnessMax }); }
public MaterialHardness(Material Material, Hardness Hardness) { MaterialID = Material.MaterialID; MaterialName = Material.Name; if (Hardness != null) { HardnessID = Hardness.HardnessID; HardnessName = Hardness.Value; FullValue = MaterialName + "@" + HardnessName; } else { HardnessID = 0; HardnessName = ""; FullValue = MaterialName + "@"; } }
private void SetHardnessTint(Hardness hardness) { switch (hardness) { case Hardness.Light: _sprite.Modulate = _lightColor; break; case Hardness.Medium: _sprite.Modulate = _mediumColor; break; case Hardness.Hard: _sprite.Modulate = _hardColor; break; } }
public override void OnSimulateStartAlways() { if (EnhancementEnabled) { ConfigurableJoint = GetComponent <ConfigurableJoint>(); hardness = new Hardness(ConfigurableJoint); StartCoroutine(wait()); } IEnumerator wait() { var orginPos = Vector3.zero; if (sliderBlock.jointTrigger != null) { orginPos = sliderBlock.jointTrigger.position; } yield return(new WaitUntil(() => ConfigurableJoint.connectedBody != null)); //if (!EnhancementEnabled) //{ // Limit = orginLimit; // HardnessIndex = orginHardnessIndex; //} if (lockToggle.IsActive) { ConfigurableJoint.xMotion = ConfigurableJointMotion.Locked; } else { ConfigurableJoint.autoConfigureConnectedAnchor = false; //ConfigurableJoint.connectedAnchor -= transform.forward * extendSlider.Value; ConfigurableJoint.connectedAnchor = ConfigurableJoint.connectedBody.transform.InverseTransformPoint(orginPos); } SoftJointLimit limit = ConfigurableJoint.linearLimit; limit.limit = /*Limit =*/ Mathf.Abs(/*Limit*/ limitSlider.Value); ConfigurableJoint.linearLimit = limit; hardness.SwitchWoodHardness(/*HardnessIndex*/ HardnessMenu.Value, ConfigurableJoint); yield break; } }
public int Save(Hardness Hardness) { if (Hardness.HardnessID == 0) { _context.Hardnesses.Add(Hardness); } else { Hardness _dbEntry = _context.Hardnesses.Find(Hardness.HardnessID); if (_dbEntry != null) { _dbEntry.Value = Hardness.Value; _dbEntry.MaterialID = Hardness.MaterialID; _dbEntry.Enabled = Hardness.Enabled; } } _context.SaveChanges(); return(Hardness.HardnessID); }
public string[] GetData() { return(new string[] { Name, Starts.ToString(), Wins.ToString(), AlmostWins.ToString(), Loses.ToString(), Hardness.ToString() + "%", EmotionFactor.ToString() + "%" }); }
public int SaveHardness(Hardness Hardness) { int _hardnessID = _hardnessRepository.Save(Hardness); return(_hardnessID); }