import pygame
from controls.controlsbase import ControlsBase
from controls.dualsense_controller import DualSenseController
from controls.dualsense_edge_controller import DualSenseEdgeController
from controls.logitech_f310_controller import LogitechF310Controller
from controls.logitech_f510_controller import LogitechF510Controller
from controls.logitech_f710_controller import LogitechF710Controller
from controls.xbox_controller import XboxController
from controls.generic_controller import GenericController

CONTROLLERS = {
    "DualSense Wireless Controller": DualSenseController,
    "DualSense Edge Wireless Controller": DualSenseEdgeController,
    "Logitech Gamepad F310": LogitechF310Controller,
    "Logitech Gamepad F510": LogitechF510Controller,
    "Logitech Gamepad F710": LogitechF710Controller,
    "Xbox": XboxController
    }

class Controllers:
    def __init__(self, joy):
        self.controllers = []
        if not joy.get_name() in CONTROLLERS:
            self.controllers.append(GenericController(joy))
        else:
            self.controllers.append(CONTROLLERS[joy.get_name()](joy))
        