Package org.freerealm.player

Examples of org.freerealm.player.SettlementManager


                } else if (subNode.getNodeName().equals("nation")) {
                    int nationId = Integer.parseInt(subNode.getFirstChild().getNodeValue());
                    player.setNation(realm.getNationManager().getNation(nationId));
                } else if (subNode.getNodeName().equals("cities")) {
                    SettlementManagerXMLConverter settlementManagerXMLConverter = new SettlementManagerXMLConverter(player);
                    SettlementManager settlementManager = settlementManagerXMLConverter.initializeFromNode(realm, subNode);
                    player.setSettlementManager(settlementManager);
                } else if (subNode.getNodeName().equals("units")) {
                    new UnitManagerXMLWrapper(player.getUnitManager()).initializeFromNode(realm, subNode);
                } else if (subNode.getNodeName().equals("builtTileImprovementsCount")) {
View Full Code Here


        xml.append("</cities>");
        return xml.toString();
    }

    public SettlementManager initializeFromNode(Realm realm, Node node) {
        SettlementManager settlementManager = new SettlementManager(freeRealmPlayer);
        for (Node subNode = node.getFirstChild(); subNode != null; subNode = subNode.getNextSibling()) {
            if (subNode.getNodeType() == Node.ELEMENT_NODE) {
                Settlement settlement = new Settlement(realm);
                settlement.setPlayer(settlementManager.getPlayer());
                new CityXMLWrapper(settlement).initializeFromNode(realm, subNode);
                settlementManager.addSettlement(settlement);
            }
        }
        return settlementManager;
    }
View Full Code Here

TOP

Related Classes of org.freerealm.player.SettlementManager

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.