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: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: server console cleanup patch v2
From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Date: Tue, 8 Jan 2002 14:55:29 +0100 (MET)

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
        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.

Yours,
Per

"Oil industry spokesmen dismissed as "absurd" and "nonsense" allegations
by aid experts, veteran East Africa analysts and several prominent Somalis
that President Bush, a former Texas oilman, was moved to act in Somalia,
at least in part, by the U.S. corporate oil stake." -- L.A. Times




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