Package org.freerealm.unit

Examples of org.freerealm.unit.ContainerManager


        xml.append("</ContainerManager>\n");
        return xml.toString();
    }

    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);
        }
        Node populationNode = XMLConverterUtility.findNode(node, "containedPopulation");
        if (populationNode != null) {
            int population = Integer.parseInt(populationNode.getFirstChild().getNodeValue());
            containerManager.setContainedPopulation(population);
        }
        return containerManager;
    }
View Full Code Here

TOP

Related Classes of org.freerealm.unit.ContainerManager

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.