-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseScene.py
More file actions
55 lines (43 loc) · 1.23 KB
/
BaseScene.py
File metadata and controls
55 lines (43 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from abc import ABC, abstractmethod
import pygame
import pyghelpers
from typing import List, Optional, Any
class BaseScene(pyghelpers.Scene, ABC):
def __init__(self, window: pygame.Surface):
super().__init__()
self._window = window
self._scene_key: str = ""
self._is_active: bool = False
@property
def window(self) -> pygame.Surface:
return self._window
@property
def scene_key(self) -> str:
return self._scene_key
@scene_key.setter
def scene_key(self, value: str) -> None:
self._scene_key = value
@property
def is_active(self) -> bool:
return self._is_active
@is_active.setter
def is_active(self, value: bool) -> None:
self._is_active = value
@abstractmethod
def getSceneKey(self) -> str:
pass
@abstractmethod
def enter(self, data: Optional[Any] = None) -> None:
pass
@abstractmethod
def handleInputs(self, eventsList: List[pygame.event.Event], keyPressedList: List[int]) -> None:
pass
@abstractmethod
def update(self) -> None:
pass
@abstractmethod
def draw(self) -> None:
pass
@abstractmethod
def leave(self) -> Optional[Any]:
pass