private void fromJSONTeam(JSONValue json_value, bool ignore_extras) { Debug.Assert(json_value != null); SportsTeamNewJSON convert_classy = SportsTeamNewJSON.from_json(json_value, ignore_extras, true); setTeam(convert_classy); }
private void fromJSONTeams(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 Teams of SportsSeriesStatusNewJSON is not an array."); } int count1 = json_array1.componentCount(); if (count1 < 2) { throw new Exception("The value for field Teams of SportsSeriesStatusNewJSON has too few elements."); } List <SportsTeamNewJSON> vector_Teams1 = new List <SportsTeamNewJSON>(count1); for (int num1 = 0; num1 < count1; ++num1) { SportsTeamNewJSON convert_classy = SportsTeamNewJSON.from_json(json_array1.component(num1), ignore_extras, true); vector_Teams1.Add(convert_classy); } Debug.Assert(vector_Teams1.Count >= 2); initTeams(); for (int num1 = 0; num1 < vector_Teams1.Count; ++num1) { appendTeams(vector_Teams1[num1]); } for (int num1 = 0; num1 < vector_Teams1.Count; ++num1) { } }
private void fromJSONValue(JSONValue json_value, bool ignore_extras) { Debug.Assert(json_value != null); TypeValue or_result = new TypeValue(); bool or_done = false; if (!or_done) { try { SportsTeamNewJSON convert_classy = SportsTeamNewJSON.from_json(json_value, ignore_extras, true); or_result.u.choice0 = convert_classy; or_result.key = 0; or_done = true; } catch (Exception) { } } if (!or_done) { try { SportsPlayerJSON convert_classy = SportsPlayerJSON.from_json(json_value, ignore_extras, true); or_result.u.choice1 = convert_classy; or_result.key = 1; or_done = true; } catch (Exception) { } } if (!or_done) { throw new Exception("The value for field Value of SportsTeamOrPlayerJSON is not one of the allowed values."); } setValue(or_result); switch (or_result.key) { case 0: break; case 1: break; default: Debug.Assert(false); break; } }