sep-pm-platformer/project/level/elements/LevelElement.py

24 lines
716 B
Python

import uuid
from abc import abstractmethod
from typing import Optional
from level.Level import Level
from physics.SpriteManager import SpriteManager
from sprite.SpritesheetManager import SpritesheetManager
class LevelElement:
def __init__(self, tile: dict, loaded_level, level_screen_manager: 'LevelScreenManager'):
self.tile = tile
self.loaded_level = loaded_level
self.level_screen_manager: 'LevelScreenManager' = level_screen_manager
if 'id' in tile:
self.id = tile['id']
else:
self.id = uuid.uuid4()
@abstractmethod
def load(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, level: Level):
pass