import abc import pygame from config.sys import * class DrawableItem(metaclass=abc.ABCMeta): @abc.abstractmethod def draw(self, window: pygame.Surface): pass @staticmethod def _get_relative_pos(pos: tuple[float, float]) -> tuple[float, float]: return (SCREEN_WIDTH - TABLE_WIDTH) / 2 + pos[0], (SCREEN_HEIGHT - TABLE_HEIGHT) / 2 + pos[1] @staticmethod def _get_table_pos(pos: tuple[float, float]) -> tuple[float, float]: return pos[0] - (SCREEN_WIDTH - TABLE_WIDTH) / 2, pos[1] - (SCREEN_HEIGHT - TABLE_HEIGHT) / 2