[Kde-games-devel] Kreversi: small cleanup patch

Inge Wallin inge at lysator.liu.se
Sun May 30 23:41:27 CEST 2004


On Sun, 30 May 2004, Rob Kaper wrote:

> On Sunday 30 May 2004 03:03 pm, Inge Wallin wrote:
> > However, there was already a class Player in kreversi, except that the
> > concept it encoded was not a player at all but a color. So here is a small
> > cleanup patch that changes the name of the class Player into Color, and
> > also fixes all its usages.
>
> It might make more sense to make the color a property of player, instead of a
> seperate entity.

I don't think so.  A player is for me an entity that can make moves.  In
a game like kreversi, it might mean the human operator, a builtin AI or an
external AI that communicates with the GUI through some mechanism.

This player entity can be used to either select moves of one color during
a game, or both colors (e.g in a human-human match or AI-AI) or maybe even
no color at all if we have more players than two available.

It might even be so that a certain player plays only a subset of the moves
for one color during the game.  This can be seen in cases like pair go
(the game of go, that is) where two players each play every second move
for one color.  I don't know if the concept is used in other games than
go, but there is nothing in principle to stop it.

So, I think that having color as a property of a player is a bad idea.
Maybe a complete class is overkill, but if we want to remove it, we must
do a bigger effort than just changing it.

	-Inge



More information about the kde-games-devel mailing list