Skip to content

Commit

Permalink
Added more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Maxwell committed Apr 25, 2023
1 parent 8b212f6 commit 91cb354
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 10 additions & 1 deletion droid/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def __init__(self, droid: object) -> None:
Args:
droid (object): The droid instance to use.
"""

self.droid = droid
Expand Down Expand Up @@ -135,6 +134,9 @@ async def close_script(self, script_id: int = 0) -> None:
def __calculate_reaction_time(self, interval: int) -> int:
"""
Calculates the time in seconds from a park beacon's reaction interval.
Args:
interval (int): Reaction interval received from a location beacon
"""

interval = interval * 5
Expand All @@ -145,6 +147,13 @@ def __calculate_reaction_time(self, interval: int) -> int:

async def __perform_droid_location_reactions(self, locations: list) -> None:
"""
Executes a script associated with each park location beacon that the droid enters.
Args:
locations (list): A list of location beacon addresses to react to
Returns:
int: The calculated reaction time in seconds.
"""

# Verify we have at least one location to react to first.
Expand Down
11 changes: 11 additions & 0 deletions droid/voice.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
"""
This module provides a voice controller for SWGE droids that attempts to match the droid's configured affiliation
to a tone of voice based on the available audio banks in the droid's memory.
It contains a `DroidVoiceController` class that has methods to get voice bank IDs for different tones of
voice based on the droid's affiliation.
The `DroidVoiceTone` class defines identifiers for the possible tones of voice to use when speaking.
The `talk_with_animation` method of the `DroidVoiceController` class sends a command to the droid to speak with a random animation and audio file
based around the tone supplied when invoked.
This code is MIT licensed.
"""

from droid.hardware import DroidAffiliation, DroidAudioBankIdentifier
Expand Down

0 comments on commit 91cb354

Please sign in to comment.