private void fromJSONPlayerPositions(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 PlayerPositions of SportsPlayerPositionsResponseStateJSON is not an array."); } int count1 = json_array1.componentCount(); if (count1 < 1) { throw new Exception("The value for field PlayerPositions of SportsPlayerPositionsResponseStateJSON has too few elements."); } List <SportsPlayerPositionJSON> vector_PlayerPositions1 = new List <SportsPlayerPositionJSON>(count1); for (int num1 = 0; num1 < count1; ++num1) { SportsPlayerPositionJSON convert_classy = SportsPlayerPositionJSON.from_json(json_array1.component(num1), ignore_extras, true); vector_PlayerPositions1.Add(convert_classy); } Debug.Assert(vector_PlayerPositions1.Count >= 1); initPlayerPositions(); for (int num1 = 0; num1 < vector_PlayerPositions1.Count; ++num1) { appendPlayerPositions(vector_PlayerPositions1[num1]); } for (int num1 = 0; num1 < vector_PlayerPositions1.Count; ++num1) { } }
public void appendPlayerPositions(SportsPlayerPositionJSON to_append) { if (!flagHasPlayerPositions) { flagHasPlayerPositions = true; storePlayerPositions.Clear(); } Debug.Assert(flagHasPlayerPositions); storePlayerPositions.Add(to_append); }
public void appendPosition(SportsPlayerPositionJSON to_append) { if (!flagHasPosition) { flagHasPosition = true; storePosition.Clear(); } Debug.Assert(flagHasPosition); storePosition.Add(to_append); }
public void appendPlayerPositions(string chars) { SportsPlayerPositionJSON.TypeValueKnownValues known = SportsPlayerPositionJSON.stringToValue(chars); SportsPlayerPositionJSON.TypeValue new_value = new SportsPlayerPositionJSON.TypeValue(); if (known == SportsPlayerPositionJSON.TypeValueKnownValues.Value__none) { new_value.in_known_list = false; new_value.string_value = chars; } else { new_value.in_known_list = true; new_value.list_value = known; } appendPlayerPositions(new_value); }