Search in sources :

Example 31 with InitHolder

use of gmgen.plugin.InitHolder in project pcgen by PCGen.

the class ExperienceAdjusterModel method populateLists.

/**
	 * Populate lists
	 */
void populateLists() {
    if (combat != null) {
        party.removeAllElements();
        enemies.removeAllElements();
        for (int i = 0; i < combat.size(); i++) {
            InitHolder iH = combat.get(i);
            if (iH instanceof Combatant) {
                Combatant cbt = (Combatant) iH;
                if (cbt.getCombatantType().equals("PC")) {
                    party.addElement(new ExperienceListItem(cbt));
                } else if (cbt.getCombatantType().equals("Enemy")) {
                    if (cbt.getStatus() == State.Dead || cbt.getStatus() == State.Defeated) {
                        enemies.addElement(new ExperienceListItem(cbt));
                    }
                }
            }
        }
    }
}
Also used : Combatant(gmgen.plugin.Combatant) InitHolder(gmgen.plugin.InitHolder)

Aggregations

InitHolder (gmgen.plugin.InitHolder)31 PcgCombatant (gmgen.plugin.PcgCombatant)18 XMLCombatant (plugin.initiative.XMLCombatant)13 Combatant (gmgen.plugin.Combatant)11 InitHolderList (gmgen.plugin.InitHolderList)7 ArrayList (java.util.ArrayList)7 Event (gmgen.plugin.Event)6 ActionEvent (java.awt.event.ActionEvent)6 HyperlinkEvent (javax.swing.event.HyperlinkEvent)6 ListSelectionEvent (javax.swing.event.ListSelectionEvent)6 List (java.util.List)5 Vector (java.util.Vector)2 Element (org.jdom2.Element)2 SaveModel (plugin.initiative.SaveModel)2 Spell (gmgen.plugin.Spell)1 SystemHP (gmgen.plugin.SystemHP)1 SystemInitiative (gmgen.plugin.SystemInitiative)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 Writer (java.io.Writer)1