Class NPCDataManager

java.lang.Object
com.jackdaw.chatwithnpc.npc.NPCDataManager

public class NPCDataManager extends Object
A serializer used to read or write the data from the files.

This data is related to the NPC's chat content.

Read or Write the data file with some information, each file just record one relative information.

  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • theFile

      private final File theFile
    • npc

      private final NPCEntity npc
  • Constructor Details

    • NPCDataManager

      NPCDataManager(@NotNull @NotNull NPCEntity npc)
  • Method Details

    • mkdir

      private static void mkdir()
    • isExist

      public boolean isExist()
      Check if the file is existed.
      Returns:
      true if the file is existed, otherwise false.
    • sync

      public void sync()
      Synchronize the data from the file to the NPC.
    • save

      public void save()
      Save the data from the NPC to the file.