From b78eb7b9bf409f29279889e115cfebd35b6e7927 Mon Sep 17 00:00:00 2001 From: alwayscompiling Date: Fri, 22 Jul 2022 21:41:45 -0400 Subject: [PATCH] Changed order of functions. --- utilities/data_storage.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/utilities/data_storage.py b/utilities/data_storage.py index ec9e096..1e62eea 100644 --- a/utilities/data_storage.py +++ b/utilities/data_storage.py @@ -7,6 +7,22 @@ HIGHSCORES_CONFIG_FILE = "highscores_config.json" HIGHSCORES_DATA_FILE = "highscores_data.json" +def create_message_map(data: dict): + """ + Creates a message map from input highscores data. + + @param data: highscores_data dict to create map from. + @return: dict message_map of message to boss. + """ + + message_map = {} + + for boss, info in data["tables"].items(): + message_map[info["message_id"]] = boss + + return message_map + + def open_highscores_config(): """ Opens the highscores config file and returns. @@ -39,22 +55,6 @@ def open_highscores_data(): return data -def create_message_map(data: dict): - """ - Creates a message map from input highscores data. - - @param data: highscores_data dict to create map from. - @return: dict message_map of message to boss. - """ - - message_map = {} - - for boss, info in data["tables"].items(): - message_map[info["message_id"]] = boss - - return message_map - - def save_highscores_data(data): """ Saves the highscores data dict into a json file.