import json


class Config(object):
    def __init__(self, file_location):
        with open(file_location, 'r') as f:
            config = json.load(f)
            self.SCREEN_WIDTH = int(config["SCREEN_WIDTH"])
            self.SCREEN_HEIGHT = int(config["SCREEN_HEIGHT"])
            self.MAP_WIDTH = int(config["MAP_WIDTH"])
            self.MAP_HEIGHT = int(config["MAP_HEIGHT"])
            self.PANEL_HEIGHT = int(config["PANEL_HEIGHT"])
            self.FULL_SCREEN = bool(config["FULL_SCREEN"])
            self.CAMERA_WIDTH = int(config["CAMERA_WIDTH"])
            self.CAMERA_HEIGHT = int(config["CAMERA_HEIGHT"])
            self.VISION_RADIUS = int(config["VISION_RADIUS"])
            self.FOV_ALGO = int(config["FOV_ALGO"])
            self.FOV_LIGHT_WALLS = bool(config["FOV_LIGHT_WALLS"])
            self.HP_BAR_WIDTH = int(config["HP_BAR_WIDTH"])

            # Derived values
            self.PANEL_Y = self.SCREEN_HEIGHT - self.PANEL_HEIGHT
            # etc etc etc

[(7, 'json.load', 'json.load', False, 'import json\n')]