convenience function
This commit is contained in:
parent
bfe83d4f43
commit
20f4cfc67e
1 changed files with 7 additions and 1 deletions
|
@ -27,7 +27,13 @@ class EndgameAction:
|
||||||
denominator: int
|
denominator: int
|
||||||
|
|
||||||
|
|
||||||
def analyze_game_from_db(game_id: int, refresh_cache=False):
|
def analyze_and_store_game(game_id: int) -> int:
|
||||||
|
actions, return_code = analyze_game_from_db(game_id)
|
||||||
|
store_endgame_actions(game_id, actions)
|
||||||
|
return return_code
|
||||||
|
|
||||||
|
|
||||||
|
def analyze_game_from_db(game_id: int, refresh_cache=False) -> Tuple[List[EndgameAction], int]:
|
||||||
# In order to pass the game replay to the endgame analyzer (a C++ program), we use the hanab.live json format.
|
# In order to pass the game replay to the endgame analyzer (a C++ program), we use the hanab.live json format.
|
||||||
# In order to avoid to need to use the /export endpoint of hanab.live, we create the json replay ourselves from
|
# In order to avoid to need to use the /export endpoint of hanab.live, we create the json replay ourselves from
|
||||||
# the information stored in the database. Note that this is partially lossy, since the GameState class we use here
|
# the information stored in the database. Note that this is partially lossy, since the GameState class we use here
|
||||||
|
|
Loading…
Reference in a new issue