Exemple #1
0
            protected override void finish(int winning_index)
            {
                Typepickup_estimate result = new Typepickup_estimate();

                result.key = winning_index;
                switch (winning_index)
                {
                case 0:
                {
                    Debug.Assert(field0.have_value);
                    result.u.choice0 = Double.Parse(field0.value);
                    break;
                }

                case 1:
                {
                    Debug.Assert(field1.have_value);
                    result.u.choice1 = field1.value;
                    break;
                }

                default:
                {
                    Debug.Assert(false);
                    break;
                }
                }
                handle_result(result);
            }
Exemple #2
0
 public Holderpickup_estimate(Holderpickup_estimate other)
 {
     have_data = other.haveData();
     data      = other.referenced();
     if (have_data)
     {
     }
 }
Exemple #3
0
 public Holderpickup_estimate(Typepickup_estimate init_data)
 {
     have_data = true;
     data      = init_data;
     if (have_data)
     {
     }
 }
Exemple #4
0
    public void setpickup_estimate(Typepickup_estimate new_value)
    {
        flagHaspickup_estimate = true;
        switch (new_value.key)
        {
        case 0:
            break;

        case 1:
            break;

        default:
            Debug.Assert(false);
            break;
        }
        storepickup_estimate = new_value;
    }
Exemple #5
0
 protected override void handle_result(Typepickup_estimate result)
 {
     top.value.Add(result);
 }
Exemple #6
0
 protected override void handle_result(Typepickup_estimate result)
 {
     //@@@        Debug.Assert(!have_value);
     have_value = true;
     value      = new Holderpickup_estimate(result);
 }
Exemple #7
0
 protected abstract void handle_result(Typepickup_estimate result);
Exemple #8
0
    private void  fromJSONpickup_estimate(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        Typepickup_estimate or_result = new Typepickup_estimate();
        bool or_done = false;

        if (!or_done)
        {
            try
            {
                JSONRationalValue json_rational = json_value.rational_value();
                double            the_double;
                if (json_rational != null)
                {
                    the_double = json_rational.getDouble();
                }
                else
                {
                    JSONIntegerValue json_integer = json_value.integer_value();
                    if (json_integer != null)
                    {
                        the_double = json_integer.getLongInt();
                    }
                    else
                    {
                        throw new Exception("The value for ??? is not a number.");
                    }
                }
                or_result.u.choice0 = the_double;
                or_result.key       = 0;
                or_done             = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            try
            {
                or_result.key = 1;
                or_done       = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            throw new Exception("The value for field pickup_estimate of EstimateUberResponseJSON is not one of the allowed values.");
        }
        setpickup_estimate(or_result);
        switch (or_result.key)
        {
        case 0:
            break;

        case 1:
            break;

        default:
            Debug.Assert(false);
            break;
        }
    }