Search in sources :

Example 1 with RequestToSavePlayerCharacterMessage

use of pcgen.pluginmgr.messages.RequestToSavePlayerCharacterMessage in project pcgen by PCGen.

the class InitiativePlugin method fileSave.

/**
	 * <p>
	 * Saves the combatants to a file
	 * </p>
	 */
private void fileSave() {
    for (int i = 0; i < theView.initList.size(); i++) {
        InitHolder iH = theView.initList.get(i);
        if (iH instanceof PcgCombatant) {
            PcgCombatant pcgcbt = (PcgCombatant) iH;
            messageHandler.handleMessage(new RequestToSavePlayerCharacterMessage(this, pcgcbt.getPC()));
        }
    }
    theView.saveToFile();
}
Also used : PcgCombatant(gmgen.plugin.PcgCombatant) RequestToSavePlayerCharacterMessage(pcgen.pluginmgr.messages.RequestToSavePlayerCharacterMessage) InitHolder(gmgen.plugin.InitHolder)

Example 2 with RequestToSavePlayerCharacterMessage

use of pcgen.pluginmgr.messages.RequestToSavePlayerCharacterMessage in project pcgen by PCGen.

the class GMGenMessageHandler method handleSavePcgMessage.

private void handleSavePcgMessage(PCGenMessage message) {
    RequestToSavePlayerCharacterMessage smessage = (RequestToSavePlayerCharacterMessage) message;
    PlayerCharacter pc = smessage.getPc();
    for (Iterator<CharacterFacade> iterator = CharacterManager.getCharacters().iterator(); iterator.hasNext(); ) {
        CharacterFacade facade = iterator.next();
        if (facade.matchesCharacter(pc)) {
            CharacterManager.saveCharacter(facade);
            break;
        }
    }
}
Also used : RequestToSavePlayerCharacterMessage(pcgen.pluginmgr.messages.RequestToSavePlayerCharacterMessage) PlayerCharacter(pcgen.core.PlayerCharacter) CharacterFacade(pcgen.facade.core.CharacterFacade)

Aggregations

RequestToSavePlayerCharacterMessage (pcgen.pluginmgr.messages.RequestToSavePlayerCharacterMessage)2 InitHolder (gmgen.plugin.InitHolder)1 PcgCombatant (gmgen.plugin.PcgCombatant)1 PlayerCharacter (pcgen.core.PlayerCharacter)1 CharacterFacade (pcgen.facade.core.CharacterFacade)1