[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pbmserv-dev] Adding a command to a game



Thinking it over, it hurts my object oriented
sensibilities to extend the base class in this way. 
Basically adding interfaces to the base is the last
refuge of a scoundrel.

I think it would be much cleaner to have a command
registry in the base object and let the individual
games register a handler for a given command.  That
way we can arbitrarily extend the command set without
ever having to modify the base or worry about
associated incompatibilities.

Just a thought...

Lyman

PS Of course implied here is a willingness to help
code...

--- Lyman Hurd <lhurd@yahoo.com> wrote:

> Right I just mean that a game option was not viable
> in
> that case because it doesn't "know" that lyman wants
> the game listing as "sgf" if the server does not
> know
> it if lyman doing the asking!
> 
> Cheers,
> 
> Lyman
> 
> --- Robert Barrell <games@rdbhn.org> wrote:
> 
> > Lyman Hurd wrote:
> > 
> > >Well yes, come to think of it there are somw
> > drawbacks
> > >to what I was proposing.  For example, if you do
> a
> > >"show" rather than a "showas" you are not in the
> > >context of any specific user.
> > >  
> > >
> > Thanks, Lyman.  Actually, user context (as in
> > "showas") is not important 
> > for SGF.  The format is absolute, and the programs
> > that display the 
> > games usually have "board flip" options.
> > 
> > >Possibly adding a command is the most reasonable
> > >option...
> > >
> > >As noted virtual methods can have a default
> > >implementation usable by all classes that do not
> > >specifically override it, or in some cases a
> method
> > >can be made "pure virtual" in which case any
> > concrete
> > >class that extends the base is forced to override
> > it.
> > >  
> > >
> > Still working on it.  The "not implemented"
> default
> > works, but I'm 
> > getting a segmentation fault when the Go version
> of
> > the function is called.
> > 
> > 
> > To unsubscribe, send a message to
> esquire@gamerz.net
> > with
> > 	unsubscribe pbmserv-dev@gamerz.net
> > as the BODY of the message.  The SUBJECT is
> ignored.
> > 
> > 
> 
> 
> To unsubscribe, send a message to esquire@gamerz.net
> with
> 	unsubscribe pbmserv-dev@gamerz.net
> as the BODY of the message.  The SUBJECT is ignored.
> 
>