Class MPCConfig

java.lang.Object
com.deco2800.game.files.MPCConfig

public class MPCConfig
extends java.lang.Object
Class to record the MPC attire configuration into a JSON file that is locally persisted

Predefined player properties are loaded from a config stored as a json file and should have the properties stores in 'PlayerConfig'.

  • Constructor Summary

    Constructors 
    Constructor Description
    MPCConfig()  
  • Method Summary

    Modifier and Type Method Description
    static PlayerConfig getValues()
    Retrieve PlayerConfig values if they exist, else create a new PlayerConfig
    void readValues()
    Store the current values into a JSON file
    static void updateAttire​(java.lang.String attireType)
    Retrieve the current attire value and update PlayerConfig
    static void updateValues()
    Update the current attire value to OG in the JSON file when no attire has been selected
    static void updateValues​(PlayerConfig values)
    Write the current attire value into the JSON file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • readValues

      public void readValues()
      Store the current values into a JSON file
    • updateAttire

      public static void updateAttire​(java.lang.String attireType)
      Retrieve the current attire value and update PlayerConfig
    • updateValues

      public static void updateValues​(PlayerConfig values)
      Write the current attire value into the JSON file
    • updateValues

      public static void updateValues()
      Update the current attire value to OG in the JSON file when no attire has been selected
    • getValues

      public static PlayerConfig getValues()
      Retrieve PlayerConfig values if they exist, else create a new PlayerConfig
      Returns:
      PlayerConfig