public new static DoubleVariable Random() { var x = new DoubleVariable(); x.SetRandomValues(); return(x); }
public void IsEmptyTest() { Assert.IsFalse(Obj.IsEmpty()); Assert.IsFalse(new DoubleVariable().IsEmpty()); Assert.IsFalse(DoubleVariable.Random().IsEmpty()); Assert.IsTrue(DoubleVariable.Empty.IsEmpty()); }
public override void OnInspectorGUI() { DrawDefaultInspector(); DoubleVariable myScript = (DoubleVariable)target; if (GUILayout.Button("Invoke")) { myScript.ValueChangedEvent.Invoke(); } }
private static DoubleVariableSerializer CreateSerializer(BitStream stream, int minValue, int maxValue, int decimalPlace) { DoubleVariable variable = new DoubleVariable(0, "DoubleVar") { MinValue = minValue, MaxValue = maxValue, DecimalPlaces = decimalPlace }; var serializer = new DoubleVariableSerializer(variable); return(serializer); }
public void EditorSetVariableData(DoubleVariable global, DoubleVariableInstanced instanced, double constant, AssignmentType type, IDTokenHolder tokenHolder) { _assignmentType = type; EditorSetTokenHolder(tokenHolder); switch (type) { case AssignmentType.Constant: _constantValue = constant; break; case AssignmentType.GlobalVariable: _globalVariable = global; break; case AssignmentType.PersonalVariable: _instancedVariable = instanced; break; } }
public virtual void Run(Product product) { DateTime start = DateTime.Now; ErrorCode = 0; try { product.Engine = this; ErrorCode = product.Run(Context); SetErrorcode(ErrorCode); } catch (TeflonDoubleAssertFailException e) { SetErrorcode(e.ErrorCode); } catch (TeflonBoolAssertFailException e) { SetErrorcode(e.ErrorCode); } catch (TeflonIntAssertFailException e) { SetErrorcode(e.ErrorCode); } catch (TeflonStringAssertFailException e) { SetErrorcode(e.ErrorCode); } catch (TeflonCommunicationException e) { SetErrorcode(e.ErrorCode); } finally { DoubleVariable time = (DateTime.Now - start).TotalSeconds; time.Name = "TotalTestTime"; product.Dispose(); } }
public DoubleVariableSerializer(DoubleVariable variable) { _variable = variable; _bitLength = LenghtSerializer.GetBitsLengthDouble(variable.MinValue, variable.MaxValue, variable.DecimalPlaces); }
internal static double?Convert(this DoubleVariable variable) => variable?.Value;