Re: [Freeciv-Dev] Flags on demand
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Artur Biesiadowski wrote:
>
> Currently there are some flags in rulesets and surely there will be
> more. All of them have hardcoded meanings. With C code it is maybe ok,
> but with script language we will be limiting ourselves.
>
> My idea is to allow any flags to be defined. More they should be handled
> transparently to ruleset writer, script writer and even C writer (except
> few interface routines). So there will be no many flag fields, but just
>
> has_unit_flag(int flag)
> has_city_flag(int flag)
>
> etc.
>
> Flag as int would not be available directly anywhere. It would have to
> be obtained through
> int get_unit_flag(const char * flagname)
> If we would like to sacrifice a bit of performance for readibility we
> could directly use has_unit_flag(const char * flagname) every time.
>
Are there any flags that are used so often in the code that
one would loose more than a bit of performance ?
I think movement related flags might fall in this category .. .
--
Peter Schäfer - mailto:schaefer@xxxxxx, schaefer@xxxxxx
|
|