/** {@inheritDoc} */ @Override protected void readAttributes(FreeColXMLReader xr) throws XMLStreamException { super.readAttributes(xr); final AIMain aiMain = getAIMain(); destination = xr.getLocationAttribute(aiMain.getGame(), DESTINATION_TAG, false); // Delegate transportable one level down }
/** {@inheritDoc} */ @Override protected void writeAttributes(FreeColXMLWriter xw) throws XMLStreamException { super.writeAttributes(xw); // Write identifier, Location will match Object if (destination != null) { xw.writeAttribute(DESTINATION_TAG, destination.getId()); if (transportable != null) { xw.writeAttribute(TRANSPORTABLE_TAG, transportable.getId()); } } }
/** Disposes of this <code>AIObject</code> by removing any references to this object. */ @Override public void dispose() { this.destination = null; this.transportable = null; super.dispose(); }