aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/utils/export.py
diff options
context:
space:
mode:
authorPhilip Paquette <pcpaquette@gmail.com>2019-09-11 12:58:45 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-09-14 18:18:53 -0400
commitabb42dcd4886705d6ba8af27f68ef605218ac67c (patch)
tree9ae16f7a09fff539fa72e65198e284bca6ac3376 /diplomacy/utils/export.py
parenta954a00d263750c279dbb2c0a9ae85707022bcd7 (diff)
Added ReadtheDocs documentation for the public API
- Reformatted the docstring to be compatible - Added tests to make sure the documentation compiles properly - Added sphinx as a pip requirement Co-authored-by: Philip Paquette <pcpaquette@gmail.com> Co-authored-by: notoraptor <stevenbocco@gmail.com>
Diffstat (limited to 'diplomacy/utils/export.py')
-rw-r--r--diplomacy/utils/export.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/diplomacy/utils/export.py b/diplomacy/utils/export.py
index 6c54689..7ff68d2 100644
--- a/diplomacy/utils/export.py
+++ b/diplomacy/utils/export.py
@@ -26,9 +26,11 @@ RULES_TO_SKIP = ['SOLITAIRE', 'NO_DEADLINE', 'CD_DUMMIES', 'ALWAYS_WAIT', 'IGNOR
def to_saved_game_format(game):
""" Converts a game to a standardized JSON format
+
:param game: game to convert.
- :return: A game in the standard JSON format used to saved game (returned object is a dictionary)
- :type game: Game
+ :return: A game in the standard format used to saved game, that can be converted to JSON for serialization
+ :type game: diplomacy.engine.game.Game
+ :rtype: Dict
"""
# Get phase history.
@@ -53,6 +55,7 @@ def to_saved_game_format(game):
def is_valid_saved_game(saved_game):
""" Checks if the saved game is valid.
This is an expensive operation because it replays the game.
+
:param saved_game: The saved game (from to_saved_game_format)
:return: A boolean that indicates if the game is valid
"""