Move colorization to the display layer

Color output isn't necessarily always going to be a terminal output
thing, and terminals don't always support the same escape codes (e.g. on
Windows). Thus, all colorization efforts are done in the Display rather
than in the Game.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2021-11-28 17:37:37 -08:00
parent 2357757b23
commit c71077a8f3
4 changed files with 43 additions and 46 deletions

View File

@@ -2,10 +2,11 @@ import argparse
import importlib.util
from pathlib import Path
import sys
from agame.color import colorize
from agame.display import ANSIDisplay
from agame.game import Game
# TODO - conditional import for this based on OS
from agame.display import ANSIDisplay
# Parse args
parser = argparse.ArgumentParser(