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 Details

    • onStartSession

      void onStartSession(StartSessionEvent e)
      Called when a user logs in or enables telemetry.
      Parameters:
      e - the SessionStartEvent to be recorded to the JSON database.
    • onNormalEncounterStart

      void onNormalEncounterStart(NormalEncounterStartEvent e)
      Called when a normal encounter starts.
      Parameters:
      e - the NormalEncounterStartEvent to be recorded to the JSON database.
    • onNormalEncounterComplete

      void onNormalEncounterComplete(NormalEncounterCompleteEvent e)
      Called when a normal encounter is completed.
      Parameters:
      e - the NormalEncounterCompleteEvent to be recorded to the JSON database.
    • onNormalEncounterFail

      void onNormalEncounterFail(NormalEncounterFailEvent e)
      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

      void onBossEncounterStart(BossEncounterStartEvent e)
      Called when a boss encounter is started.
      Parameters:
      e - the BossEncounterStartEvent to be recorded to the JSON database.
    • onBossEncounterComplete

      void onBossEncounterComplete(BossEncounterCompleteEvent e)
      Called when a boss encounter is completed.
      Parameters:
      e - the BossEncounterCompleteEvent to be recorded to the JSON database.
    • onBossEncounterFail

      void onBossEncounterFail(BossEncounterFailEvent e)
      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

      void onGainCoin(GainCoinEvent e)
      Called when the player gains coins.
      Parameters:
      e - the GainCoinEvent to be recorded to the JSON database.
    • onBuyUpgrade

      void onBuyUpgrade(BuyUpgradeEvent e)
      Called when the player buys an upgrade.
      Parameters:
      e - the BuyUpgradeEvent to be recorded to the JSON database.
    • onEndSession

      void onEndSession(EndSessionEvent e)
      Called when the user signs out or disables telemetry.
      Parameters:
      e - the EndSessionEvent to be recorded to the JSON database.
    • onSettingsChange

      void onSettingsChange(SettingsChangeEvent e)
      Called when a setting is changed by the user.
      Parameters:
      e - the SettingsChangeEvent to be recorded to the JSON database.
    • onKillEnemy

      void onKillEnemy(KillEnemyEvent e)
      Called when an enemy is killed.
      Parameters:
      e - the KillEnemyEvent to be recorded to the JSON database.
    • setDestinationFile

      void setDestinationFile(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.
      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.