Summary: Specenum & user flag names
                 Project: Freeciv
            Submitted by: cazfi
            Submitted on: Tue 10 Jul 2012 04:50:37 AM EEST
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 



We currently support ruleset defined "user flags" for unit types. These are
flags that have no hardcoded meaning in freeciv engine, but can be used as
requirement for effects, bases, roads...
In our supplied rulesets just one user flag is used. Only units with flag
"Airbase" can build airbases.

Unit type user flags are possible because unit type flags, unlike most other
flag types, are not specenum. Their full implementation would not be possible
with current specenum.

Similar user flags would make sense about other objects too. What I've often
wanted would be method to group terrain types (to give group of terrain types
user flag) and make that requirement for something (road/base).

This ticket is for discussion about what we can do. Does someone see some way
to make specenums to support user flags in a good way? I don't. 1) Specenum
depends on compile time flag names, one cannot set them ruleset load time. 2)
I see no easy way to make generic specenum_gen.h that could automatically
create range of special values after manually defined ones ("#define
SPECENUM_USER_FLAGS_COUNT 4" before including specenum_gen.h)

I think we can only define user flags (with no hardcoded meaning) as:

and then either accept that user flags are named "User1", "User2"... or to use
manually written flag name access functions instead of automatically generated
xxx_name() & xxx_by_name().


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to