/** * Write a given stage of the full NPC data. * * @param source the parsed NPC that is the data source * @param target the writer that is the target * @param stage the current stage that is supposed to be processed * @throws IOException thrown in case the writing operations fail */ private void writeStage(final ParsedNpc source, final Writer target, final WritingStage stage) throws IOException { final int count = source.getDataCount(); EasyNpcWritable writeable = null; for (int i = 0; i < count; ++i) { writeable = source.getEasyNpcData(i); writeable.writeEasyNpc(target, stage); } }