public override Symbol <DateTime> Assignment(Symbol <DateTime> right, AssignmentType type) { switch (type) { case AssignmentType.Assign: Value = right.Value; return(this); default: return(IllegalAssignment(right, type.ToString())); } }
public override Symbol <Id> Assignment(Symbol <Id> right, AssignmentType type) { switch (type) { case AssignmentType.Assign: Value = new Id(right.Value.Identifier); return(this); default: return(IllegalAssignment(right, type.ToString())); } }
public override Symbol <string> Assignment(Symbol <string> right, AssignmentType type) { switch (type) { case AssignmentType.Assign: Value = right.Value; return(this); case AssignmentType.AddDifference: Value += right.Value; return(this); default: return(IllegalAssignment(right, type.ToString())); } }
public override Symbol <Array <T> > Assignment(Symbol <Array <T> > right, AssignmentType type) { ArraySymbol <T> rightArray = right as ArraySymbol <T>; Assert.IsNotNull(rightArray); switch (type) { case AssignmentType.Assign: Value.Elements = new List <Expression <T> >(rightArray.Value.Elements); return(this); default: return(IllegalAssignment(right, type.ToString())); } }
public override Symbol <float> Assignment(Symbol <float> right, AssignmentType type) { switch (type) { case AssignmentType.Assign: Value = right.Value; return(this); case AssignmentType.AddDifference: Value += right.Value; return(this); case AssignmentType.SubstractDifference: Value -= right.Value; return(this); case AssignmentType.MultiplyBy: Value *= right.Value; return(this); case AssignmentType.DivideBy: Value /= right.Value; return(this); case AssignmentType.PoweredBy: Value %= right.Value; return(this); case AssignmentType.ModuloBy: Value = Mathf.Pow(Value, right.Value); return(this); default: return(IllegalAssignment(right, type.ToString())); } }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("phoneNumberType"); writer.WriteStringValue(PhoneNumberType.ToString()); writer.WritePropertyName("assignmentType"); writer.WriteStringValue(AssignmentType.ToString()); writer.WritePropertyName("capabilities"); writer.WriteObjectValue(Capabilities); if (Optional.IsDefined(AreaCode)) { writer.WritePropertyName("areaCode"); writer.WriteStringValue(AreaCode); } if (Optional.IsDefined(Quantity)) { writer.WritePropertyName("quantity"); writer.WriteNumberValue(Quantity.Value); } writer.WriteEndObject(); }
protected void ToString(List <string> toStringOutput) { toStringOutput.Add($"AssignmentType = {(AssignmentType == null ? "null" : AssignmentType.ToString())}"); toStringOutput.Add($"LocationIds = {(LocationIds == null ? "null" : $"[{ string.Join(", ", LocationIds)} ]")}"); }