Class: BasePetClasses

Pets~ BasePetClasses


new BasePetClasses()

Manages base information for all pet classes.
Source:

Members


<private> _baseFile :string

The filename of the file to read class information from.
Type:
  • string
Default Value:
  • ./save/petClasses.json
Source:

<private> _classes :object

Parsed data from file.
Type:
  • object
Default Value:
  • {}
Source:

Methods


<private> _fileUpdate(curr, prev)

File has been modified, re-read and parse data.
Parameters:
Name Type Description
curr fs.Stats Current file stats.
prev fs.Stats Previous file stats.
Source:

<private> _readFile()

Read and parse data from the file.
Source:

get(petClass)

Fetch base object for a class.
Parameters:
Name Type Description
petClass string Name of class to fetch.
Source:
Returns:
Object reference of pet information for the class, or null if could not be found.
Type
object

initialize()

Start watching file system changes and read pet information from file.
Source:

random()

Fetch a base object for a random class.
Source:
Returns:
Object reference of pet information for the class, or null if could not be found.
Type
object

shutdown()

Stop watching for file system changes, and remove all event listeners.
Source: