Search in sources :

Example 1 with TraitPointsStatus

use of delta.games.lotro.stats.traitPoints.TraitPointsStatus in project lotro-companion by dmorcellet.

the class MainTestTraitPointsWindow method doIt.

private void doIt() {
    CharacterFile file = new LotroTestUtils().getToonByName("Meva");
    TraitPointsStatus status = new TraitPointsStatus();
    CharacterSummary summary = file.getSummary();
    TraitPointsEditionWindowController windowController = new TraitPointsEditionWindowController(null, summary, status);
    windowController.show(true);
    System.out.println(status);
}
Also used : CharacterSummary(delta.games.lotro.character.CharacterSummary) TraitPointsStatus(delta.games.lotro.stats.traitPoints.TraitPointsStatus) LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 2 with TraitPointsStatus

use of delta.games.lotro.stats.traitPoints.TraitPointsStatus in project lotro-companion by dmorcellet.

the class CharacterFileWindowController method editTraitPoints.

private void editTraitPoints() {
    CharacterSummary summary = _toon.getSummary();
    TraitPointsStatus pointsStatus = TraitPoints.get().load(_toon);
    TraitPointsEditionWindowController controller = new TraitPointsEditionWindowController(this, summary, pointsStatus);
    TraitPointsStatus newStatus = controller.editModal();
    if (newStatus != null) {
        TraitPoints.get().save(_toon, newStatus);
    }
}
Also used : CharacterSummary(delta.games.lotro.character.CharacterSummary) TraitPointsStatus(delta.games.lotro.stats.traitPoints.TraitPointsStatus) TraitPointsEditionWindowController(delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController)

Example 3 with TraitPointsStatus

use of delta.games.lotro.stats.traitPoints.TraitPointsStatus in project lotro-companion by dmorcellet.

the class TraitPointsStatusXMLParser method parseXML.

/**
 * Parse the XML file.
 * @param source Source file.
 * @return Parsed status or <code>null</code>.
 */
public TraitPointsStatus parseXML(File source) {
    TraitPointsStatus status = null;
    Element root = DOMParsingTools.parse(source);
    if (root != null) {
        status = parseStatus(root);
    }
    return status;
}
Also used : TraitPointsStatus(delta.games.lotro.stats.traitPoints.TraitPointsStatus) Element(org.w3c.dom.Element)

Example 4 with TraitPointsStatus

use of delta.games.lotro.stats.traitPoints.TraitPointsStatus in project lotro-companion by dmorcellet.

the class TraitPointsStatusXMLParser method parseStatus.

private TraitPointsStatus parseStatus(Element root) {
    TraitPointsStatus status = new TraitPointsStatus();
    List<Element> pointTags = DOMParsingTools.getChildTagsByName(root, TraitPointsRegistryXMLConstants.TRAIT_POINT_TAG, false);
    for (Element pointTag : pointTags) {
        NamedNodeMap attrs = pointTag.getAttributes();
        String id = DOMParsingTools.getStringAttribute(attrs, TraitPointsRegistryXMLConstants.TRAIT_POINT_ID_ATTR, null);
        status.setStatus(id, true);
    }
    return status;
}
Also used : NamedNodeMap(org.w3c.dom.NamedNodeMap) TraitPointsStatus(delta.games.lotro.stats.traitPoints.TraitPointsStatus) Element(org.w3c.dom.Element)

Aggregations

TraitPointsStatus (delta.games.lotro.stats.traitPoints.TraitPointsStatus)4 CharacterSummary (delta.games.lotro.character.CharacterSummary)2 Element (org.w3c.dom.Element)2 CharacterFile (delta.games.lotro.character.CharacterFile)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 TraitPointsEditionWindowController (delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController)1 NamedNodeMap (org.w3c.dom.NamedNodeMap)1