Class Achievement

java.lang.Object
com.csse3200.game.components.quests.Achievement

public class Achievement extends Object
Represents an achievement. An achievement has a name, description, completion status, visibility status, type, and an icon path. Implements the Json.Serializable interface for serialization and deserialization of achievement data.
  • Constructor Details

    • Achievement

      public Achievement()
      Default constructor for the Achievement class used for json.
    • Achievement

      public Achievement(String questName, String questDescription, Boolean completed, Boolean seen, Achievement.AchievementType type, String iconPath)
      Constructs an Achievement with the specified parameters.
      Parameters:
      questName - The name of the quest.
      questDescription - A brief description of the quest.
      completed - Indicates whether the achievement is completed.
      seen - Indicates whether the achievement has been seen.
      type - The type of achievement.
      iconPath - The file path to the icon representing the achievement.
  • Method Details

    • getQuestName

      public String getQuestName()
      Getter method for the quest name.
      Returns:
      String representation of the quest's name.
    • getQuestDescription

      public String getQuestDescription()
      Getter method for the quest description.
      Returns:
      String representation of the quest's description
    • isCompleted

      public boolean isCompleted()
      Checks if the current achievement has been completed
      Returns:
      True if it has been completed, False otherwise
    • complete

      public void complete()
      Complete the current achievement.
    • isSeen

      public boolean isSeen()
      Checks if the current achievement has been seen
      Returns:
      True if it has been completed, False otherwise
    • setSeen

      public void setSeen()
      Notes the achievement has been seen
    • getType

      public Achievement.AchievementType getType()
      Gets the type of the achievement.
      Returns:
      The achievement type.
    • getPath

      public String getPath()
      Gets the icon path for the achievement.
      Returns:
      The file path to the icon representing the achievement.
    • toString

      public String toString()
      Returns a string representation of the achievement.
      Overrides:
      toString in class Object
      Returns:
      A string containing all the achievement properties.