Example #1
0
 protected void finish(SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON result)
 {
     if (fieldGeneratorEventInstancesIndex.have_value)
     {
         result.setEventInstancesIndex(fieldGeneratorEventInstancesIndex.value);
         fieldGeneratorEventInstancesIndex.have_value = false;
     }
     else if ((!(result.hasEventInstancesIndex())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"EventInstancesIndex\" field was missing.");
     }
     if (fieldGeneratorMedalWinnersIndices.have_value)
     {
         result.initMedalWinnersIndices();
         int count = fieldGeneratorMedalWinnersIndices.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendMedalWinnersIndices(fieldGeneratorMedalWinnersIndices.value[num]);
         }
         fieldGeneratorMedalWinnersIndices.value.Clear();
         fieldGeneratorMedalWinnersIndices.have_value = false;
     }
     if (fieldGeneratorParticipantsIndices.have_value)
     {
         result.initParticipantsIndices();
         int count = fieldGeneratorParticipantsIndices.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendParticipantsIndices(fieldGeneratorParticipantsIndices.value[num]);
         }
         fieldGeneratorParticipantsIndices.value.Clear();
         fieldGeneratorParticipantsIndices.have_value = false;
     }
 }
Example #2
0
    private void  fromJSONEventInstancesMappings(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 EventInstancesMappings of SportsOlympicsEventSchedulesAndResultsQueryResultJSON is not an array.");
        }
        int count1 = json_array1.componentCount();
        List <SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON> vector_EventInstancesMappings1 = new List <SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON convert_classy = SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_EventInstancesMappings1.Add(convert_classy);
        }
        initEventInstancesMappings();
        for (int num1 = 0; num1 < vector_EventInstancesMappings1.Count; ++num1)
        {
            appendEventInstancesMappings(vector_EventInstancesMappings1[num1]);
        }
        for (int num1 = 0; num1 < vector_EventInstancesMappings1.Count; ++num1)
        {
        }
    }
Example #3
0
 public void appendEventInstancesMappings(SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON to_append)
 {
     if (!flagHasEventInstancesMappings)
     {
         flagHasEventInstancesMappings = true;
         storeEventInstancesMappings.Clear();
     }
     Debug.Assert(flagHasEventInstancesMappings);
     storeEventInstancesMappings.Add(to_append);
 }
Example #4
0
        protected override void finish()
        {
            SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON result = new SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON();

            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.extraSportsOlympicsEventSchedulesAndResultsEventInstanceMappingAppendPair(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);
        }
Example #5
0
 protected override void handle_result(SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON result)
 {
     top.value.Add(result);
 }
Example #6
0
        protected override void handle_result(SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
Example #7
0
 protected abstract void handle_result(SportsOlympicsEventSchedulesAndResultsEventInstanceMappingJSON new_result);