Search in sources :

Example 1 with SaveModel

use of plugin.initiative.SaveModel in project pcgen by PCGen.

the class Initiative method hyperLinkSelected.

/**
	 * <p>Called when a hyperlink is selected in one of the text panes in {@code tpaneInfo}.
	 * Used to generate attack/skill, etc. dialogs.</p>
	 *
	 * @param e {@code HyperLinkEvent} that called this method.
	 * @param cbt {@code PcgCombatant} to perform action for.
	 */
private void hyperLinkSelected(HyperlinkEvent e, InitHolder cbt) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        PObjectModel model = PObjectModel.Factory(e.getDescription());
        if (model != null) {
            if ((model instanceof AttackModel) && (cbt instanceof PcgCombatant)) {
                InitHolder pcgcbt = cbt;
                performAttack((AttackModel) model, pcgcbt);
            } else if (model instanceof CheckModel) {
                performCheck((CheckModel) model);
            } else if (model instanceof SpellModel) {
                castSpell((SpellModel) model, cbt);
            } else if (model instanceof SaveModel) {
                performSave((SaveModel) model, cbt);
            } else if ((model instanceof DiceRollModel) && (cbt instanceof PcgCombatant)) {
                performDiceRoll((DiceRollModel) model);
            }
        }
    }
}
Also used : PcgCombatant(gmgen.plugin.PcgCombatant) SpellModel(plugin.initiative.SpellModel) DiceRollModel(plugin.initiative.DiceRollModel) PObjectModel(plugin.initiative.PObjectModel) SaveModel(plugin.initiative.SaveModel) AttackModel(plugin.initiative.AttackModel) CheckModel(plugin.initiative.CheckModel) InitHolder(gmgen.plugin.InitHolder)

Example 2 with SaveModel

use of plugin.initiative.SaveModel in project pcgen by PCGen.

the class Initiative method rollSave.

//** End Functions implementing button calls for top toolbar **
//** Functions implementing button calls for the bottom toolbar **
/**
	 * Save the initiative roll
	 */
private void rollSave() {
    final List<InitHolder> selectedList = getSelected();
    //int dc = 0;
    //int type = SavingThrowDialog.NULL_SAVE;
    SaveModel model = new SaveModel();
    while (!selectedList.isEmpty()) {
        InitHolder iH = selectedList.remove(0);
        if (iH instanceof Combatant) {
            model = performSave(model, iH);
        }
    }
    refreshTable();
}
Also used : SaveModel(plugin.initiative.SaveModel) Combatant(gmgen.plugin.Combatant) PcgCombatant(gmgen.plugin.PcgCombatant) XMLCombatant(plugin.initiative.XMLCombatant) InitHolder(gmgen.plugin.InitHolder)

Aggregations

InitHolder (gmgen.plugin.InitHolder)2 PcgCombatant (gmgen.plugin.PcgCombatant)2 SaveModel (plugin.initiative.SaveModel)2 Combatant (gmgen.plugin.Combatant)1 AttackModel (plugin.initiative.AttackModel)1 CheckModel (plugin.initiative.CheckModel)1 DiceRollModel (plugin.initiative.DiceRollModel)1 PObjectModel (plugin.initiative.PObjectModel)1 SpellModel (plugin.initiative.SpellModel)1 XMLCombatant (plugin.initiative.XMLCombatant)1