pythonified

This commit is contained in:
Lukas Nöllemeyer 2024-08-16 22:54:20 +02:00
parent 0ea61c91b5
commit fe5d2bb24e

View file

@ -52,8 +52,8 @@ class InGame(State):
def on_draw(self, console: tcod.console.Console) -> None: def on_draw(self, console: tcod.console.Console) -> None:
"""Draw the standard screen.""" """Draw the standard screen."""
centers = g.world.Q.all_of(tags=[IsPlayer]) centers = g.world.Q.all_of(tags=[IsPlayer])
centers = list(map(lambda a: a.components[Position], centers)) centers = [a.components[Position] for a in centers]
center = reduce(lambda a,b: a.components[Position]+b.components[Position], centers) center = sum(centers, start=Position(0,0))
center = center.mod(len(centers)) center = center.mod(len(centers))
def draw(e): def draw(e):