[Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Can you show some examples of simple_set_statement and
> object_set_statement. IMHO should these two be unified. So
>
> set players Caesar ailevel hard; OR
> set players.Caesar.ailevel=hard;
>
> should be use the same syntax as a
>
> set unit archer vison 2; OR
> set unit.archer.vision=2;
simple_set_statement is intended for toplevel attributes:
set huts 0;
set ailevel hard;
set min_dist_bw_cities = 4;
object_set_statement in the trivial case looks like this:
set unit archer vision_range 2;
And, as you say, can be re-expressed as:
set unit.archer.vision_range 2;
so that it follows the simple_set_statement syntax.
But, in the complex case it looks like this:
set unit archer
name = "Longbowmen"
vision_range 2,
hitpoints = 15;
I.e., like the object create syntax, the object spec creates a context for
later attribute setting. We can do away with any of the complex attribute
setting by making the set statement always simple, using the dotted syntax for
object references, and separating create and attribute settings. So
create tech atomic_theory
name = _("Atomic Theory"),
req1 = "Theory of Gravity",
req2 = "Physics",
flags = "";
becomes:
create tech.atomic_theory;
set tech.atomic_theory.name _("Atomic Theory");
set tech.atomic_theory.req1 = "Theory of Gravity";
[etc.]
The complex syntax is nicer to read, IMHO, but it may be desirable to go with
the simpler syntax.
Note that either syntax requires that the identifier name (atomic_theory) be a
proper identifier, and not a name ("Atomic Theory") (or an id).
Arien
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger.
http://im.yahoo.com
- [Freeciv-Dev] Re: Server/ruleset unification & grammars [Was [RFC PATCH] init_techs], (continued)
- [Freeciv-Dev] Re: Server/ruleset unification & grammars [Was [RFC PATCH] init_techs], Stepan Roh, 2001/09/24
- [Freeciv-Dev] Re: [RFC PATCH] init_techs, Reinier Post, 2001/09/24
- [Freeciv-Dev] Re: [RFC PATCH] init_techs, Raimar Falke, 2001/09/24
- [Freeciv-Dev] Re: [RFC PATCH] init_techs, Greg Wooledge, 2001/09/24
- [Freeciv-Dev] Server/ruleset unification [Was [RFC PATCH] init_techs], Arien Malec, 2001/09/24
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Raimar Falke, 2001/09/25
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Arien Malec, 2001/09/25
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Raimar Falke, 2001/09/25
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Arien Malec, 2001/09/25
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Raimar Falke, 2001/09/25
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs],
Arien Malec <=
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Daniel L Speyer, 2001/09/25
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Daniel Sjölie, 2001/09/26
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Justin Moore, 2001/09/26
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Daniel Sjölie, 2001/09/26
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Raimar Falke, 2001/09/26
- [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs], Arien Malec, 2001/09/28
- [Freeciv-Dev] commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/09/28
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Arien Malec, 2001/09/29
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/09/30
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Raimar Falke, 2001/09/30
|
|