use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.
the class MainTestDetailedCharacterStatsPanelController method doIt.
private void doIt() {
CharacterData meva = loadCharacter("meva");
CharacterData giswald = loadCharacter("giswald");
BasicStatsSet stats = giswald.getStats();
BasicStatsSet reference = meva.getStats();
DetailedCharacterStatsPanelController panelCtrl = new DetailedCharacterStatsPanelController(null);
JPanel panel = panelCtrl.getPanel();
panelCtrl.setStats(reference, stats);
JFrame frame = new JFrame();
frame.add(panel);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.
the class MainTestStatsEditionPanelController method buildStats.
private BasicStatsSet buildStats() {
BasicStatsSet stats = new BasicStatsSet();
stats.setStat(STAT.AGILITY, 224);
stats.setStat(STAT.PHYSICAL_MASTERY, 1180);
stats.setStat(STAT.DEVASTATE_MAGNITUDE_PERCENTAGE, 2.5f);
stats.setStat(STAT.AUDACITY, 132);
stats.setStat(STAT.MORALE, 12);
return stats;
}
use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.
the class ItemChoiceTableController method buildStatColumn.
private TableColumnController<Item, FixedDecimalsInteger> buildStatColumn(final STAT stat) {
CellDataProvider<Item, FixedDecimalsInteger> statCell = new CellDataProvider<Item, FixedDecimalsInteger>() {
@Override
public FixedDecimalsInteger getData(Item item) {
BasicStatsSet stats = item.getStats();
FixedDecimalsInteger value = stats.getStat(stat);
return value;
}
};
TableColumnController<Item, FixedDecimalsInteger> statColumn = new TableColumnController<Item, FixedDecimalsInteger>(stat.name(), stat.getName(), FixedDecimalsInteger.class, statCell);
statColumn.setWidthSpecs(55, 55, 50);
return statColumn;
}
use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.
the class ItemEditionPanelController method getItem.
/**
* Get the current value of the edited item.
* @return An item.
*/
public Item getItem() {
// Name
_item.setName(_name.getText());
// Slot
_item.setEquipmentLocation(_slot.getSelectedItem());
// Stats
BasicStatsSet stats = _item.getStats();
stats.clear();
stats.setStats(_stats.getStats());
// Item level
_item.setItemLevel(_itemLevel.getSelectedItem());
// Minimum level
_item.setMinLevel(_minLevel.getSelectedItem());
// Description
_item.setDescription(_description.getText());
// Birth name
_item.setBirthName(_birthName.getText());
// Crafter name
_item.setCrafterName(_crafterName.getText());
// User comments
String userComments = _userComments.getText();
if (userComments.length() > 0) {
_item.setProperty(ItemConstants.USER_COMMENT, userComments);
} else {
_item.removeProperty(ItemConstants.USER_COMMENT);
}
// Binding
_item.setBinding(_binding.getSelectedItem());
// Unicity
_item.setUnique(_unique.isSelected());
// Durability
_item.setDurability(_durability.getValue());
// Sturdiness
_item.setSturdiness(_sturdiness.getSelectedItem());
// Stack max
_item.setStackMax(_stackMax.getValue());
// Quality
_item.setQuality(_quality.getSelectedItem());
// Essences
List<Item> selectedEssences = _essencesEditor.getEssences();
EssencesSet essences = null;
if (selectedEssences.size() > 0) {
essences = new EssencesSet(selectedEssences.size());
for (int i = 0; i < selectedEssences.size(); i++) {
essences.setEssence(i, selectedEssences.get(i));
}
}
_item.setEssences(essences);
// Armour specifics
if (_item instanceof Armour) {
Armour armour = (Armour) _item;
Integer armourValue = _armourValue.getValue();
if (armourValue != null) {
armour.setArmourValue(armourValue.intValue());
}
armour.setArmourType(_armourType.getSelectedItem());
}
// Weapon specifics
if (_item instanceof Weapon) {
Weapon weapon = (Weapon) _item;
Integer minDamage = _minDamage.getValue();
if (minDamage != null) {
weapon.setMinDamage(minDamage.intValue());
}
Integer maxDamage = _maxDamage.getValue();
if (maxDamage != null) {
weapon.setMaxDamage(maxDamage.intValue());
}
Float dps = _dps.getValue();
if (dps != null) {
weapon.setDPS(dps.floatValue());
}
weapon.setDamageType(_damageType.getSelectedItem());
weapon.setWeaponType(_weaponType.getSelectedItem());
}
// Legendary specifics
if (_item instanceof Legendary) {
Legendary legendary = (Legendary) _item;
_relicsEditor.getData(legendary.getLegendaryAttrs());
}
return _item;
}
use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.
the class CharacterStatsSummaryPanelController method update.
/**
* Update contents.
*/
public void update() {
STAT[] stats = STAT.values();
int nbStats = stats.length;
for (int i = 0; i < nbStats; i++) {
String statValue = "";
if (_toon != null) {
BasicStatsSet characterStats = _toon.getStats();
FixedDecimalsInteger value = characterStats.getStat(stats[i]);
if (value != null) {
statValue = String.valueOf(value.intValue());
} else {
statValue = "-";
}
}
if (_statValues[i] != null) {
_statValues[i].setText(statValue);
}
}
DetailedCharacterStatsWindowController detailsStatsController = getDetailsController();
if (detailsStatsController != null) {
detailsStatsController.update();
}
StatContribsWindowController contribsController = getContribsController();
if (contribsController != null) {
contribsController.update();
}
}
Aggregations