Add display abstraction
In case we want to run this on something that isn't an ANSI terminal, we have the option to implement it however we want. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
18
agame/display/__init__.py
Normal file
18
agame/display/__init__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import platform
|
||||
from .display import Display
|
||||
|
||||
if platform.system() in ("Linux", "Darwin", "Unix"):
|
||||
from .unix import *
|
||||
|
||||
|
||||
class BasicDisplay(Display):
|
||||
"""
|
||||
A basic display that should be supported on all platforms. It just outputs
|
||||
text with some color.
|
||||
"""
|
||||
|
||||
def line(self, line: str = ""):
|
||||
print(line)
|
||||
|
||||
def input(self) -> str:
|
||||
return input("> ")
|
||||
Reference in New Issue
Block a user