Source code for yracing.ranking.ranking

from abc import ABCMeta
from yyagl.gameobject import GameObject
#from .logic import RankingLogic
from .gui import RankingGui


[docs]class RankingFacade: # [('carname2points', lambda obj: obj.logic.carname2points)] #('load', lambda obj: obj.logic.load),
[docs] def show(self): return self.gui.show()
[docs] def hide(self): return self.gui.hide()
[docs] def reset(self): return self.logic.reset()
[docs] def attach_obs(self, obs_meth, sort=10, rename='', args=[]): return self.gui.attach(obs_meth, sort, rename, args)
[docs] def detach_obs(self, obs_meth, lambda_call=None): return self.gui.detach(obs_meth, lambda_call)
[docs]class Ranking(GameObject, RankingFacade): __metaclass__ = ABCMeta def __init__(self, car_names, background_fpath, font, fg_col): GameObject.__init__(self) self.gui = RankingGui(self, background_fpath, font, fg_col) #self.logic = RankingLogic(self, car_names)
[docs] def destroy(self): self.gui.destroy() #self.logic.destroy() GameObject.destroy(self)