Package org.freerealm.player.mission

Examples of org.freerealm.player.mission.Reward


    public String getRewardsXML(Mission mission) {
        StringBuffer xml = new StringBuffer();
        xml.append("<rewards>\n");
        Iterator<Reward> iterator = mission.getRewardsIterator();
        while (iterator.hasNext()) {
            Reward reward = iterator.next();
            String xMLConverterName = TagManager.getXMLConverterName(reward.getName());
            Class c;
            try {
                c = Class.forName(xMLConverterName);
                XMLConverter<Reward> xMLConverter = (XMLConverter<Reward>) c.newInstance();
                xml.append(xMLConverter.toXML(reward));
View Full Code Here


    public void initializeMissionRewardsFromNode(Realm realm, Node node, AbstractMission mission) {
        Node rewardsNode = XMLConverterUtility.findNode(node, "rewards");
        for (Node rewardNode = rewardsNode.getFirstChild(); rewardNode != null; rewardNode = rewardNode.getNextSibling()) {
            if (rewardNode.getNodeType() == Node.ELEMENT_NODE) {
                Reward reward = createReward(realm, rewardNode);
                mission.addReward(reward);
            }
        }
    }
View Full Code Here

            }
        }
    }

    private Reward createReward(Realm realm, Node node) {
        Reward reward = null;
        String xMLConverterName = TagManager.getXMLConverterName(node.getNodeName());
        try {
            XMLConverter<Reward> xMLConverter = (XMLConverter<Reward>) Class.forName(xMLConverterName).newInstance();
            reward = xMLConverter.initializeFromNode(realm, node);
        } catch (Exception exception) {
View Full Code Here

TOP

Related Classes of org.freerealm.player.mission.Reward

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.