Package org.freerealm.xmlwrapper.map

Examples of org.freerealm.xmlwrapper.map.ResourceStorageManagerXMLConverter


    }

    public String toXML(ContainerManager containerManager) {
        StringBuffer xml = new StringBuffer();
        xml.append("<ContainerManager>\n");
        xml.append(new ResourceStorageManagerXMLConverter().toXML(containerManager.getResourceStorageManager()) + "\n");
        xml.append(new UnitContainerManagerXMLConverter(containerUnit).toXML(containerManager.getUnitContainerManager()) + "\n");
        if (containerManager.getContainedPopulation() > 0) {
            xml.append("<containedPopulation>" + containerManager.getContainedPopulation() + "</containedPopulation>\n");
        }
        xml.append("</ContainerManager>\n");
View Full Code Here


    }

    public ContainerManager initializeFromNode(Realm realm, Node node) {
        ContainerManager containerManager = new ContainerManager(realm, containerUnit);
        Node resourceStorageNode = XMLConverterUtility.findNode(node, "ResourceStorage");
        ResourceStorageManager resourceStorageManager = new ResourceStorageManagerXMLConverter().initializeFromNode(realm, resourceStorageNode);
        containerManager.setResourceStorageManager(resourceStorageManager);
        Node unitContainerManagerNode = XMLConverterUtility.findNode(node, "UnitContainerManager");
        if (unitContainerManagerNode != null) {
            UnitContainerManager unitContainerManager = new UnitContainerManagerXMLConverter(containerUnit).initializeFromNode(realm, unitContainerManagerNode);
            containerManager.setUnitContainerManager(unitContainerManager);
View Full Code Here

            xml.append("</workers>\n");
            xml.append("</improvement>\n");
        }
        xml.append("</improvements>\n");
        xml.append((new WorkForceManagerXMLWrapper(settlement.getWorkForceManager())).toXML() + "\n");
        xml.append(new ResourceStorageManagerXMLConverter().toXML(settlement.getStorageManager()) + "\n");
        xml.append("</City>\n");
        return xml.toString();
    }
View Full Code Here

                        }
                    }
                } else if (subNode.getNodeName().equals("allWorkForce")) {
                    (new WorkForceManagerXMLWrapper(settlement.getWorkForceManager())).initializeFromNode(realm, subNode);
                } else if (subNode.getNodeName().equals("ResourceStorage")) {
                    settlement.setStorageManager(new ResourceStorageManagerXMLConverter().initializeFromNode(realm, subNode));
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.freerealm.xmlwrapper.map.ResourceStorageManagerXMLConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.