private void fromJSONComputerData(JSONValue json_value, bool ignore_extras) { Debug.Assert(json_value != null); BattleshipPlayerDataJSON convert_classy = BattleshipPlayerDataJSON.from_json(json_value, ignore_extras, true); setComputerData(convert_classy); }
public void setUserData(BattleshipPlayerDataJSON new_value) { if (flagHasUserData) { } flagHasUserData = true; storeUserData = new_value; }
public void setComputerData(BattleshipPlayerDataJSON new_value) { if (flagHasComputerData) { } flagHasComputerData = true; storeComputerData = new_value; }
protected override void finish() { BattleshipPlayerDataJSON result = new BattleshipPlayerDataJSON(); 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.extraBattleshipPlayerDataAppendPair(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); }
protected void finish(BattleshipPlayerDataJSON result) { if (fieldGeneratorCoordinates.have_value) { result.initCoordinates(); int count = fieldGeneratorCoordinates.value.Count; for (int num = 0; num < count; ++num) { result.appendCoordinates(fieldGeneratorCoordinates.value[num]); } fieldGeneratorCoordinates.value.Clear(); fieldGeneratorCoordinates.have_value = false; } else if ((!(result.hasCoordinates())) && !allow_incomplete) { error("When parsing the object for %what%, the \"Coordinates\" field was missing."); } if (fieldGeneratorSunkShip.have_value) { result.setSunkShip(fieldGeneratorSunkShip.value); fieldGeneratorSunkShip.have_value = false; } if (fieldGeneratorShipLocations.have_value) { result.initShipLocations(); int count = fieldGeneratorShipLocations.value.Count; for (int num = 0; num < count; ++num) { result.appendShipLocations(fieldGeneratorShipLocations.value[num]); } fieldGeneratorShipLocations.value.Clear(); fieldGeneratorShipLocations.have_value = false; } if (fieldGeneratorIsGameOver.have_value) { result.setIsGameOver(fieldGeneratorIsGameOver.value); fieldGeneratorIsGameOver.have_value = false; } else if ((!(result.hasIsGameOver())) && !allow_incomplete) { error("When parsing the object for %what%, the \"IsGameOver\" field was missing."); } }
protected override void handle_result(BattleshipPlayerDataJSON result) { top.value.Add(result); }
protected override void handle_result(BattleshipPlayerDataJSON result) { //@@@ Debug.Assert(!have_value); have_value = true; value = result; }
protected abstract void handle_result(BattleshipPlayerDataJSON new_result);