Package wizardquest.telemetry
Interface TelemetryListenerInterface
public interface TelemetryListenerInterface
Interface for the telemetry listener. Provides methods to deal with telemetry
events, writing them to the JSON store of telemetry events. When a method is
called the listener should verify telemetry is enabled before writing to the
database.
NOTE: Some of the ConcreteEvent classes have not yet been created, this is
because
they are not required for Sprint 1 (e.g., BossEncounterStartEvent)
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a boss encounter is completed.voidCalled when a boss encounter is failed as the player has died and has no lives remaining.voidCalled when a boss encounter is started.voidCalled when the player buys an upgrade.voidCalled when the user signs out or disables telemetry.voidCalled when the player gains coins.voidCalled when an enemy is killed.voidCalled when a normal encounter is completed.voidCalled when a normal encounter is failed as the player has died and ran out of lives.voidCalled when a normal encounter starts.voidCalled when a setting is changed by the user.voidCalled when a user logs in or enables telemetry.voidResets the filepath to the real JSON file, events.json, after running a JUnit test.voidsetDestinationFile(File file) Allows JUnit tests to write to a temporary JSON file rather than events.json, mitigating any risk of test data corrupting the real JSON file.
-
Method Details
-
onStartSession
Called when a user logs in or enables telemetry.- Parameters:
e- the SessionStartEvent to be recorded to the JSON database.
-
onNormalEncounterStart
Called when a normal encounter starts.- Parameters:
e- the NormalEncounterStartEvent to be recorded to the JSON database.
-
onNormalEncounterComplete
Called when a normal encounter is completed.- Parameters:
e- the NormalEncounterCompleteEvent to be recorded to the JSON database.
-
onNormalEncounterFail
Called when a normal encounter is failed as the player has died and ran out of lives.- Parameters:
e- the NormalEncounterFailEvent to be recorded to the JSON database.
-
onBossEncounterStart
Called when a boss encounter is started.- Parameters:
e- the BossEncounterStartEvent to be recorded to the JSON database.
-
onBossEncounterComplete
Called when a boss encounter is completed.- Parameters:
e- the BossEncounterCompleteEvent to be recorded to the JSON database.
-
onBossEncounterFail
Called when a boss encounter is failed as the player has died and has no lives remaining.- Parameters:
e- the BossEncounterFailEvent to be recorded to the JSON database.
-
onGainCoin
Called when the player gains coins.- Parameters:
e- the GainCoinEvent to be recorded to the JSON database.
-
onBuyUpgrade
Called when the player buys an upgrade.- Parameters:
e- the BuyUpgradeEvent to be recorded to the JSON database.
-
onEndSession
Called when the user signs out or disables telemetry.- Parameters:
e- the EndSessionEvent to be recorded to the JSON database.
-
onSettingsChange
Called when a setting is changed by the user.- Parameters:
e- the SettingsChangeEvent to be recorded to the JSON database.
-
onKillEnemy
Called when an enemy is killed.- Parameters:
e- the KillEnemyEvent to be recorded to the JSON database.
-
setDestinationFile
Allows JUnit tests to write to a temporary JSON file rather than events.json, mitigating any risk of test data corrupting the real JSON file.- Parameters:
file- the temporary JSON file to be written to.
-
resetDestinationFile
void resetDestinationFile()Resets the filepath to the real JSON file, events.json, after running a JUnit test.
-