Ejemplo n.º 1
0
    private void  fromJSONSeries(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        JSONArrayValue json_array1 = json_value.array_value();

        if (json_array1 == null)
        {
            throw new Exception("The value for field Series of SportsPlayoffTriviaInformationNuggetJSON is not an array.");
        }
        int count1 = json_array1.componentCount();
        List <SportsSeriesStatusNewJSON> vector_Series1 = new List <SportsSeriesStatusNewJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            SportsSeriesStatusNewJSON convert_classy = SportsSeriesStatusNewJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_Series1.Add(convert_classy);
        }
        initSeries();
        for (int num4 = 0; num4 < vector_Series1.Count; ++num4)
        {
            appendSeries(vector_Series1[num4]);
        }
        for (int num1 = 0; num1 < vector_Series1.Count; ++num1)
        {
        }
    }
Ejemplo n.º 2
0
    private void  fromJSONSeriesStatus(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        SportsSeriesStatusNewJSON convert_classy = SportsSeriesStatusNewJSON.from_json(json_value, ignore_extras, true);

        setSeriesStatus(convert_classy);
    }
Ejemplo n.º 3
0
 public void setSeriesStatus(SportsSeriesStatusNewJSON new_value)
 {
     if (flagHasSeriesStatus)
     {
     }
     flagHasSeriesStatus = true;
     storeSeriesStatus   = new_value;
 }
Ejemplo n.º 4
0
 public void appendSeries(SportsSeriesStatusNewJSON to_append)
 {
     if (!flagHasSeries)
     {
         flagHasSeries = true;
         storeSeries.Clear();
     }
     Debug.Assert(flagHasSeries);
     storeSeries.Add(to_append);
 }
Ejemplo n.º 5
0
        protected override void finish()
        {
            SportsSeriesStatusNewJSON result = new SportsSeriesStatusNewJSON();

            Debug.Assert(result != null);
            finish(result);
            int extra_count = unknownFieldGenerator.field_names.Count;

            Debug.Assert(extra_count == unknownFieldGenerator.field_values.Count);
            for (int extra_num = 0; extra_num < extra_count; ++extra_num)
            {
                result.extraSportsSeriesStatusNewAppendPair(unknownFieldGenerator.field_names[extra_num], unknownFieldGenerator.field_values[extra_num]);
            }
            unknownFieldGenerator.field_names.Clear();
            unknownFieldGenerator.field_values.Clear();
            unknownFieldGenerator.index = new Dictionary <string, JSONValue>();
            handle_result(result);
        }
Ejemplo n.º 6
0
 protected override void handle_result(SportsSeriesStatusNewJSON result)
 {
     top.value.Add(result);
 }
Ejemplo n.º 7
0
        protected override void handle_result(SportsSeriesStatusNewJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
Ejemplo n.º 8
0
 protected abstract void handle_result(SportsSeriesStatusNewJSON new_result);
Ejemplo n.º 9
0
 protected void finish(SportsSeriesStatusNewJSON result)
 {
     if (fieldGeneratorStatus.have_value)
     {
         result.setStatus(fieldGeneratorStatus.value);
         fieldGeneratorStatus.have_value = false;
     }
     if (fieldGeneratorSpecialGameType.have_value)
     {
         result.setSpecialGameType(fieldGeneratorSpecialGameType.value);
         fieldGeneratorSpecialGameType.have_value = false;
     }
     if (fieldGeneratorTeams.have_value)
     {
         result.initTeams();
         int count = fieldGeneratorTeams.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendTeams(fieldGeneratorTeams.value[num]);
         }
         fieldGeneratorTeams.value.Clear();
         fieldGeneratorTeams.have_value = false;
     }
     else if ((!(result.hasTeams())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Teams\" field was missing.");
     }
     if (fieldGeneratorScore.have_value)
     {
         result.initScore();
         int count = fieldGeneratorScore.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendScore(fieldGeneratorScore.value[num]);
         }
         fieldGeneratorScore.value.Clear();
         fieldGeneratorScore.have_value = false;
     }
     if (fieldGeneratorSoccerAwayGoals.have_value)
     {
         result.initSoccerAwayGoals();
         int count = fieldGeneratorSoccerAwayGoals.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendSoccerAwayGoals(fieldGeneratorSoccerAwayGoals.value[num]);
         }
         fieldGeneratorSoccerAwayGoals.value.Clear();
         fieldGeneratorSoccerAwayGoals.have_value = false;
     }
     if (fieldGeneratorGamesIndices.have_value)
     {
         result.initGamesIndices();
         int count = fieldGeneratorGamesIndices.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendGamesIndices(fieldGeneratorGamesIndices.value[num]);
         }
         fieldGeneratorGamesIndices.value.Clear();
         fieldGeneratorGamesIndices.have_value = false;
     }
 }