# Path: src/helper.py
# def validate_function_key(slot_key):
# def get_output_folder():
# def get_models_folder():
# def get_dataset_folder():
# def get_home_folder():
# def pickle_object(data, name, directory=get_output_folder()):
# def generate_img_key(image):
# def get_tensor(image):
# def get_output_vector(presses):
# def get_key_state_from_vector(vector):
# 
# Path: src/keylog.py
# class Keyboard(enum.Enum):
# class KeyLog:
#     def __init__(self, logging_delay=0.3):
#     def start(self):
#     def on_press(self, key):
#     def on_release(self, key):
#     def record(self):
#     def save_to_file(self, file_name="log.json"):
#     def _get_key_value(key):


import logging
import json
import cv2
import pickle
import os
from src import helper, keylog
""" This module contains code for maintaining the basic Mario Kart AI agent's state-decision map. """



logger = logging.getLogger(__name__)


class StateModel:
    """ Class for storing the basic Mario Kart AI agent's state-decision probabilities in a lookup table.

    Attributes:
        screenshot_dir: Directory where the Dolphin emulator saves screenshots.
        keylog_filename: Name of the file where Dolphin keyboard output was logged to.
        output_dir: Directory where the Dolphin keyboard log is stored.
        image_dir: Directory containing the downsampled Dolphin images.
        state_decision_map: Dictionary containing the state to decision probability mapping.
     """

    def __init__(self, training_keylog="log.json", model_name="naive_model", clean_imgs=False):
        self.screenshot_dir = os.path.join(helper.get_home_folder(), '.dolphin-emu', 'ScreenShots')
        self.keylog_filename = training_keylog

# Path: src/helper.py
# def validate_function_key(slot_key):
# def get_output_folder():
# def get_models_folder():
# def get_dataset_folder():
# def get_home_folder():
# def pickle_object(data, name, directory=get_output_folder()):
# def generate_img_key(image):
# def get_tensor(image):
# def get_output_vector(presses):
# def get_key_state_from_vector(vector):
# 
# Path: src/keylog.py
# class Keyboard(enum.Enum):
# class KeyLog:
#     def __init__(self, logging_delay=0.3):
#     def start(self):
#     def on_press(self, key):
#     def on_release(self, key):
#     def record(self):
#     def save_to_file(self, file_name="log.json"):
#     def _get_key_value(key):


# Path: src/agents/state_model.py
import logging
import json
import cv2
import pickle
import os
from src import helper, keylog

""" This module contains code for maintaining the basic Mario Kart AI agent's state-decision map. """



logger = logging.getLogger(__name__)


class StateModel:
    """ Class for storing the basic Mario Kart AI agent's state-decision probabilities in a lookup table.

    Attributes:
        screenshot_dir: Directory where the Dolphin emulator saves screenshots.
        keylog_filename: Name of the file where Dolphin keyboard output was logged to.
        output_dir: Directory where the Dolphin keyboard log is stored.
        image_dir: Directory containing the downsampled Dolphin images.
        state_decision_map: Dictionary containing the state to decision probability mapping.
     """

    def __init__(self, training_keylog="log.json", model_name="naive_model", clean_imgs=False):
        self.screenshot_dir = os.path.join(helper.get_home_folder(), '.dolphin-emu', 'ScreenShots')
        self.keylog_filename = training_keylog

        self.output_dir = helper.get_output_folder()