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();
}
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;
}
}
}
Aggregations