# Module `Agent`

Provides the Agent class, which represents a player.

## Class Agent

subtitles.Agent:new (username) | Constructor.
subtitles.Agent:load_settings () | Loads settings from the player's metadata.
subtitles.Agent:get_player () | Returns the player's ObjectRef, or nil if the player has disconnected.
subtitles.Agent:get_display () | Returns the user's currently active display object.
subtitles.Agent:create_display () | Creates a display object according to the user's current preferences.
subtitles.Agent:get_enabled () | Checks if the player has subtitles enabled.
subtitles.Agent:set_enabled (enabled) | Enables or disables subtitles for the player.
subtitles.Agent:toggle_enabled () | Toggles subtitles on/off.
subtitles.Agent:get_footsteps_enabled () | Checks if footsteps are enabled for this player.
subtitles.Agent:set_footsteps_enabled (enabled) | Enables or disables footsteps for the player.
subtitles.Agent:toggle_footsteps_enabled () | Toggles the footsteps enabled state on/off.
subtitles.Agent:get_display_name () | Returns the player's selected display name.
subtitles.Agent:set_display_name (name) | Sets the player's display type.
subtitles.Agent:handle_footsteps () | Detects footsteps around the player and simulates sound effects.
subtitles.Agent:step (dtime) | Called every game tick.
subtitles.Agent:show_intro () | Shows an introduction message to the player.
subtitles.Agent:on_first_join () | Called when the player first joins.
subtitles.Agent:on_leave () | Called when the player leaves the game.

## Class Agent

Represents a player. Each player gets one Agent object.

subtitles.Agent:new (username)
  Constructor.

  ### Parameters:

  - username The name of the player.
subtitles.Agent:load_settings ()
  Loads settings from the player's metadata.
subtitles.Agent:get_player ()
  Returns the player's ObjectRef, or nil if the player has disconnected.

  ### Returns:

  An ObjectRef or nil.
subtitles.Agent:get_display ()
  Returns the user's currently active display object. This creates the display if necessary.

  ### Returns:

  A SubtitleDisplay object.
subtitles.Agent:create_display ()
  Creates a display object according to the user's current preferences.

  ### Returns:

  A SubtitleDisplay object.
subtitles.Agent:get_enabled ()
  Checks if the player has subtitles enabled.

  ### Returns:

  true if subtitles are enabled.
subtitles.Agent:set_enabled (enabled)
  Enables or disables subtitles for the player.

  ### Parameters:

  - enabled true to enable, or false to disable.
subtitles.Agent:toggle_enabled ()
  Toggles subtitles on/off.
subtitles.Agent:get_footsteps_enabled ()
  Checks if footsteps are enabled for this player.

  ### Returns:

  true if footsteps are enabled.
subtitles.Agent:set_footsteps_enabled (enabled)
  Enables or disables footsteps for the player.

  ### Parameters:

  - enabled true to enable, or false to disable.
subtitles.Agent:toggle_footsteps_enabled ()
  Toggles the footsteps enabled state on/off.
subtitles.Agent:get_display_name ()
  Returns the player's selected display name.

  ### Returns:

  A display name string.
subtitles.Agent:set_display_name (name)
  Sets the player's display type. This recreates the display if necessary.

  ### Parameters:

  - name A display name string.
subtitles.Agent:handle_footsteps ()
  Detects footsteps around the player and simulates sound effects.
subtitles.Agent:step (dtime)
  Called every game tick.

  ### Parameters:

  - dtime Seconds since this method was last called.
subtitles.Agent:show_intro ()
  Shows an introduction message to the player.
subtitles.Agent:on_first_join ()
  Called when the player first joins.
subtitles.Agent:on_leave ()
  Called when the player leaves the game.

generated by LDoc 1.4.6 Last updated 2023-01-14 06:51:17