Class Group

java.lang.Object
com.jackdaw.chatwithnpc.group.Group

public class Group extends Object
Group of NPC

The group will record the permanent prompt and temporary event and its parent group.

The permanent prompt and the events will be known by all the members of the group.

Every group will have parents until the parent is "Global".

Version:
1.1
  • Field Details

    • name

      protected final String name
    • instruction

      protected String instruction
    • events

      protected final ArrayList<String> events
    • parentGroup

      protected String parentGroup
    • lastLoadTime

      protected long lastLoadTime
    • memberList

      protected final ArrayList<String> memberList
  • Method Details

    • getName

      public String getName()
      Get the name of the group
      Returns:
      the name of the group
    • getParentGroup

      public String getParentGroup()
      Get the name of the parent group
      Returns:
      the name of the parent group
    • setParentGroup

      protected void setParentGroup(String parentGroup)
      Set the name of the parent group
      Parameters:
      parentGroup - the name of the parent group
    • getLastLoadTime

      public long getLastLoadTime()
      Get the last load time of the group
      Returns:
      the last load time of the group
    • getLastLoadTimeString

      public String getLastLoadTimeString()
      Get the last load time of the group in string
      Returns:
      the last load time of the group in string
    • updateLastLoadTime

      public void updateLastLoadTime(long time)
      Update the last load time of the group
      Parameters:
      time - the last load time of the group
    • addEvent

      public void addEvent(String event)
      Add an event to the group
      Parameters:
      event - the event
    • popEvent

      public void popEvent()
      Remove the last event from the group
    • getEvent

      public ArrayList<String> getEvent()
      Get the temporary event of the group
      Returns:
      the temporary event of the group
    • setInstruction

      public void setInstruction(String instruction)
      Set the instruction of the group
      Parameters:
      instruction - the instruction of the group
    • getInstruction

      public String getInstruction()
      Get the instruction of the group
      Returns:
      the instruction of the group
    • getDataManager

      public GroupDataManager getDataManager()
      Get the data manager of the group
      Returns:
      the data manager of the group
    • addMember

      protected void addMember(String member)
      Add a member to the group
      Parameters:
      member - the member to add
    • removeMember

      protected void removeMember(String member)
      Remove a member from the group
      Parameters:
      member - the member to remove
    • getMemberList

      public ArrayList<String> getMemberList()
      Get the member list of the group
      Returns:
      the member list of the group