[Freeciv-Dev] Re: server console cleanup patch v2
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [Freeciv-Dev] Re: server console cleanup patch v2, (continued)
- [Freeciv-Dev] Re: server console cleanup patch v2, Per I. Mathisen, 2002/01/07
- [Freeciv-Dev] Re: server console cleanup patch v2, Raimar Falke, 2002/01/07
- [Freeciv-Dev] Re: server console cleanup patch v2, Per I. Mathisen, 2002/01/07
- [Freeciv-Dev] Re: server console cleanup patch v2, Raimar Falke, 2002/01/07
- [Freeciv-Dev] Re: server console cleanup patch v2, Reinier Post, 2002/01/08
- [Freeciv-Dev] Re: server console cleanup patch v2, Per I. Mathisen, 2002/01/08
- [Freeciv-Dev] Re: server console cleanup patch v2, Per I. Mathisen, 2002/01/08
- [Freeciv-Dev] Re: server console cleanup patch v2,
Raimar Falke <=
- [Freeciv-Dev] Re: server console cleanup patch v2, Reinier Post, 2002/01/08
- [Freeciv-Dev] Re: server console cleanup patch v2, Reinier Post, 2002/01/08
- [Freeciv-Dev] Re: server console cleanup patch v2, Per I. Mathisen, 2002/01/08
- [Freeciv-Dev] Re: server console cleanup patch v2, Reinier Post, 2002/01/08
|
|