21 lines
615 B
Python
21 lines
615 B
Python
|
from abc import abstractmethod
|
||
|
|
||
|
from level.Level import Level
|
||
|
from physics.SpriteManager import SpriteManager
|
||
|
from sprite.SpritesheetManager import SpritesheetManager
|
||
|
|
||
|
|
||
|
class LevelElement:
|
||
|
def __init__(self, tile: dict, loaded_level):
|
||
|
self.tile = tile
|
||
|
self.loaded_level = loaded_level
|
||
|
self.sprites = []
|
||
|
|
||
|
@abstractmethod
|
||
|
def load(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, level: Level):
|
||
|
pass
|
||
|
|
||
|
def destroy(self, sprite_manager: SpriteManager):
|
||
|
for sprite in self.sprites:
|
||
|
sprite_manager.remove_ui_element(sprite)
|