Пример #1
0
        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()));
            }
        }
Пример #2
0
        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()));
            }
        }
Пример #3
0
        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()));
            }
        }
Пример #4
0
        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()));
            }
        }
Пример #5
0
        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()));
            }
        }
Пример #6
0
 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)} ]")}");
 }