Adding new selfReportSessionTime setting

This commit is contained in:
Jonathan Putney
2020-06-26 14:50:33 -04:00
parent aa03f6affb
commit ca94ee9fb5
12 changed files with 643 additions and 500 deletions

View File

@@ -62,6 +62,7 @@ export function checkValidRange(
export class BaseCMI {
jsonString = false;
#initialized = false;
#start_time;
/**
* Constructor for BaseCMI, just marks the class as abstract
@@ -80,12 +81,28 @@ export class BaseCMI {
return this.#initialized;
}
/**
* Getter for #start_time
* @return {Number}
*/
get start_time() {
return this.#start_time;
}
/**
* Called when the API has been initialized after the CMI has been created
*/
initialize() {
this.#initialized = true;
}
/**
* Called when the player should override the 'session_time' provided by
* the module
*/
setStartTime() {
this.#start_time = new Date().getTime();
}
}
/**