Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: server console cleanup patch v2
Home

[Freeciv-Dev] Re: server console cleanup patch v2

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Cc: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: server console cleanup patch v2
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 8 Jan 2002 17:39:04 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Jan 08, 2002 at 02:55:29PM +0100, Per I. Mathisen wrote:
> On Tue, 8 Jan 2002, Per I. Mathisen wrote:
> > > Your example in that syntax becomes
> > >
> > >   [game_timeout]
> > >   name            = _("timeout")
> > >   min             = 0
> > >   max             = 80
> > >   helptext        = _("\
> > >   "Sets timeout for for blah blah blah\
> > >   ")
> > >
> > > Perhaps a 'type' field is a good idea:
> > >
> > >   type            = "integer"
> > >
> > > but perhaps that is implied by the existence of 'min' and/or 'max'.
> > > Also there would be
> > >
> > >   default = 0
> > >   cmdlevel        = "ctrl"
> >
> > Thank you, this is _much_ better than what I was suggesting.
> 
> Actually, I think this one is even better, as it can be used for all
> rulesets, not just game.ruleset, and allows us to group related options in
> a logically straight-forward manner:
> 
>       [citydistance]
>       cmdlevel = "ctrl"
>       helptext = _("whatever!")
>       city_min_dist = 3
>       city_max_dist = 5

>       city_avg_dist = 2
             ^^^ you mean default?

>       city_dist_options = { "help", "we", "have", "too", "many", "options"
>                               1,      2,      3       4,      4,      2
>                               9,      4,      1,      3,      4,      1 }
> 
> "cmdlevel" and "helptext" are interpreted as special cases, the rest are
> rendered as user-changeable values. Default is whatever value the option
> is set to. However, there is no way to put min/max info in here.
> 
> In order to pull this off, I believe common/registry.c probably needs to
> put all key values into some sort of tree structure for easy/fast
> iteration. Parsing a list of key values isn't going to cut it, AFAIK.

If you want to remove all the stuff from server/stdinhand.c you still
have to think about code which is associated with the options. Like
the validation methods for example.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "A common mistake that people make, when trying to design 
  something completely foolproof is to underestimate the 
  ingenuity of complete fools."
    -- Douglas Adams in Mostly Harmless


[Prev in Thread] Current Thread [Next in Thread]