Beispiel #1
0
 def games(self):
     openGames = list()
     runningGames = list()
     finishedGames = list()
     
     #openGames.append(['id', 'player1', 'player2', '36:36'])
     #runningGames.append(['id', 'player1', 'player2', '36:36'])
     #finishedGames.append(['99', 'player1', 'player2', '36:36'])
     
     for idx, val in enumerate(app_globals.games):
         if val.state() == State.WAIT :            
            openGames.append([str(idx), val.player_name(0), val.player_name(1), val.scores()])
         elif val.state()  == State.RUN or val.state() == State.JOIN:
            runningGames.append([str(idx), val.player_name(0), val.player_name(1), val.scores()])
         elif val.state()  == State.DONE:
            finishedGames.append([str(idx), val.player_name(0), val.player_name(1), val.scores()])
             
     #return str(len(app_globals.games))                                          # Anzahl der Spiele
     #return render('/name.html') #, extra_vars={'ptitle': ptitle , 'page':page, 'systems': systems})
     return render('/portal.html', extra_vars={'openGames': openGames , 'runningGames':runningGames, 'finishedGames': finishedGames}) 
Beispiel #2
0
 def play(self, id): 
     return render('/game.html', extra_vars={'id': id, 'mode': 3})
Beispiel #3
0
 def show(self, id):
     return render('/game.html', extra_vars={'id': id, 'mode': 0})
Beispiel #4
0
 def enter(self, id):
     stateText = 'Spiel ' + str(id) + ' betreten.'
     return render('/name.html', extra_vars={'stateText': stateText,  'mode': 1, 'id' : id}) 
Beispiel #5
0
 def startgame(self):
     stateText = 'Neues Spiel erstellen.'
     return render('/name.html', extra_vars={'stateText': stateText, 'mode': 0}) 
Beispiel #6
0
    def index(self):
        ptitle = 'API Documentation'
        page = 'API Documentation'       

        return render('/doc.html', extra_vars={'ptitle': ptitle , 'page':page})