def render(self): console.print(f'{self.name}')
from lib.Component import Component from lib.Adapter import Adapter from lib.Intercepter import Intercepter from User import User from Main import Main #from MainView import MainView from Game import Game from PlayersManager import PlayersManager #from PlayersManagerView import PlayersManagerView from Board import Board from Tile import Tile user = User() component_console = Intercepter( 'console.print', lambda self, data: console.print(data.text) != 'yes', 'console') sys = Component('sys') sys.attach(user) sys.attach(Main()) game = sys.attach(Adapter(['game-start'], ['game-stopped'])) game.attach(user) game.attach(Game()) game.attach(PlayersManager()) #game.attach(PlayersManagerView()) board = game.attach(Adapter(['board.render'])) board.attach(component_console)
def render(self): for tile in self.tiles: self.send('tile.render') if tile.id % self.dimension[0] == 0: console.print('\n')