[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pbmserv-dev] can there be partners on this server?
Richard has been wanting to allow the ratings system to be changed on a
per-game basis, but hasn't figured out how to do it yet.
So here's a suggestion. Unfortunately, I'm too busy at work to try to
implement this myself...
We could add a (virtual) method to the Game class which has the
responsibility of creating the Ratings object. Normally it would not be
overridden and just create an object of the ELO Ratings class.
Games which want to use other ratings systems (FIBS, KotH, etc.) could
link in those class files and override the method to create a Ratings
object of the type that they want to use. The new ratings classes could
be implemented as subclasses of the default ratings class, or perhaps as a
subclass of an abstract class that the default ratings also inherits from.
Sound feasible? The Ratings class interface may need to be munged a bit
to accomodate different ratings systems.
~ John Williams
On Wed, 23 Jul 2003, Douglas Zander wrote:
> Sharkey, would it be possible to go in and manipulate the ratings
> file for a game directly? I understand that this would be a lot of
> programming, but could it be done? We could maybe over-ride the
> ratings.cpp file or the game.cpp file or what-ever file is neccessary?
> I guess those files aren't labeled as "virtual"? Is that what would
> be required? Is this how Richard protects certain parts of the program
> by making them non-virtual???
>
>
>