Search in sources :

Example 1 with InitHolderList

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

the class InitiativePlugin method handleInitHolderListSendMessage.

/**
	 * <p>
	 * Handles an {@code InitHolderListSendMessage} by addomg all new
	 * combatants to the views list.
	 * </p>
	 *
	 * @param message
	 */
private void handleInitHolderListSendMessage(TransmitInitiativeValuesBetweenComponentsMessage message) {
    if (message.getSource() != this) {
        InitHolderList cl = message.getInitHolderList();
        for (InitHolder iH : cl) {
            theView.addInitHolder(iH);
        }
        theView.refreshTable();
    }
}
Also used : InitHolderList(gmgen.plugin.InitHolderList) InitHolder(gmgen.plugin.InitHolder)

Example 2 with InitHolderList

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

the class GMGenMessageHandler method handleInitHolderListSendMessage.

private void handleInitHolderListSendMessage(TransmitInitiativeValuesBetweenComponentsMessage message) {
    InitHolderList list = message.getInitHolderList();
    for (int i = 0; i < list.size(); i++) {
        InitHolder iH = list.get(i);
        if (iH instanceof PcgCombatant) {
            //TODO: Resolve against the current PC list and add any new characters.
            PcgCombatant pcg = (PcgCombatant) iH;
            PlayerCharacter aPC = pcg.getPC();
            Globals.getPCList().add(aPC);
            aPC.setDirty(true);
        //				addPCTab(aPC);
        }
    }
}
Also used : PcgCombatant(gmgen.plugin.PcgCombatant) PlayerCharacter(pcgen.core.PlayerCharacter) InitHolderList(gmgen.plugin.InitHolderList) InitHolder(gmgen.plugin.InitHolder)

Example 3 with InitHolderList

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

the class EncounterPlugin method removeAll.

private void removeAll() {
    theModel.removeAllElements();
    theList = new InitHolderList();
    updateUI();
}
Also used : InitHolderList(gmgen.plugin.InitHolderList)

Example 4 with InitHolderList

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

the class EncounterPlugin method start.

/**
	 * Starts the plugin, registering itself with the {@code TabAddMessage}.
	 */
@Override
public void start(PCGenMessageHandler mh) {
    messageHandler = mh;
    theModel = new EncounterModel();
    theView = new EncounterView();
    theRaces = new RaceModel();
    theList = new InitHolderList();
    createView();
    messageHandler.handleMessage(new RequestAddTabToGMGenMessage(this, getLocalizedName(), getView()));
    initMenus();
}
Also used : RequestAddTabToGMGenMessage(gmgen.pluginmgr.messages.RequestAddTabToGMGenMessage) InitHolderList(gmgen.plugin.InitHolderList) EncounterView(plugin.encounter.gui.EncounterView)

Aggregations

InitHolderList (gmgen.plugin.InitHolderList)4 InitHolder (gmgen.plugin.InitHolder)2 PcgCombatant (gmgen.plugin.PcgCombatant)1 RequestAddTabToGMGenMessage (gmgen.pluginmgr.messages.RequestAddTabToGMGenMessage)1 PlayerCharacter (pcgen.core.PlayerCharacter)1 EncounterView (plugin.encounter.gui.EncounterView)1