public void save() { File partyFile = fileRef.getReference(); List<File> characterFiles = new ArrayList<File>(); for (CharacterFacade character : this) { characterFiles.add(character.getFileRef().getReference()); } (new PCGIOHandler()).write(partyFile, characterFiles); }
private boolean isCompanionOpen(CompanionFacade companion) { File compFile = companion.getFileRef().getReference(); if (compFile == null) { return true; } for (CharacterFacade character : CharacterManager.getCharacters()) { File charFile = character.getFileRef().getReference(); if (compFile.equals(charFile)) { return true; } } return false; }