Re: [Pypentago-devel] GameHistoryManager.py ???
Status: Pre-Alpha
Brought to you by:
segfaulthunter
From: Hardik M. <har...@gm...> - 2008-06-03 18:48:35
|
Hi J. Kovacs. The direction in which you are thinking is completely right. After I have set up this annoying many-to-many relations between GameHistory and Players, I wanted to ask you this question about How you would like to use GameHistoryManager, if we would create one. While your arguments are completely right as far as the storing the GameHistory or in your words, the functionality of report_game() method goes. But I have a few questions 1. Are we going to need queries like how many games a given player won or 2. With which player has a given player won maximum games ? 3. Or as simple as which games were played by a given player (can be as p1 as well p2) ? If we are going to need these queries it would be good to have a Manager class for GameHistory. Moreover you can create GameLogger class which calls the save_game method of GameHistoryManager class. I want to give the general interface to all the tables so the interface can be extended at anytime to implement more queries or other functionality. Yesterday, I was sick and today I had to work. So only now I am able to work on the GameHistory table. But if everything goes well, I will be able to commit at least the initial version tonight. You are in no way stepping on my toes, so feel free to create the GameLogger class. Though if it should be in GameManager module or not is a question. If it would be Java I would say no, because it has more to do with Game logic than database. regards, Hardik On Tue, Jun 3, 2008 at 8:02 PM, J. Kovacs <ko...@fr...> wrote: > Hi all, > > Does it make sense to create a GameHistoryManager.py file kind of like the > PlayerManager? > > > I'm wondering if that is where the Game Logging code will go. > > I picture at the end of the game, the server, after detecting the win > condition calls a "report_game" method; not sure if my format is correct > there. > > If I'm right, the GameHistoryManager.report_game() method > would have a couple goals: > > #1 - Log the game > Log the Game into the game history table. > > #2 - Update the current_rating of both players > Get previous game history for player 1 > Build it into a list L > Pass list to glicko2 function > rc = RatingCalculator() #create the rating calculator object > result = rc.CalculateNewRating( L, current_volatility, current_RD) > #I think the Glicko code is close to working, if given proper input. > Use returned list to save the new rating of the player back to Players > table (probably using PlayerManager, right?) > Repeat for player 2 > > > Well, just wanted to get my thoughts down here. > (I think the above makes the 2 public methods of Glicko2.py obsolete) > > > Lets create a Gna Task if GameHistoryManager.py makes sense. > Maybe I am just rushing things, if so, then disregard. > > I will be happy to work on something like that if it makes sense. > Florian and I discussed doing a GameLog class, but Maybe it makes more > sense in the /db/GameHistoryManager file. If there are no objections, I > will begin working on this; however, if I am stepping on your toes > Hardik, let me know and I will hold off and work on glicko-cleanup > instead. > > Let me know. > Thanks for your continued good communication. > > Kovacs > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pypentago-devel mailing list > Pyp...@li... > https://lists.sourceforge.net/lists/listinfo/pypentago-devel > |