[Freeciv-Dev] Re: unit type iterate
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 4 Mar 2002, Jason Short wrote:
> Gregory Berkolaiko wrote:
> > Hey you iterate wizards. How about making unit_type_iterate.
> > Here's grep to help you:
>
> Are we talking about something like
>
> #define unit_type_iterate(id) { \
> int id; \
> for (id = 0; id < game.num_unit_types; id++) {
I was thinking about the above, but the below (with id and type) could be
useful as well.
I guess the follwing can be made and be useful:
unit_type_id_iterate(id)
unit_type_iterate(id, type) (will use unit_type_id_iterate)
unit_type_simple_iterate(id, type) (simple referes to is_simple_military)
>
> or something a bit more forward-thinking (and slower) like
>
> #define unit_type_iterate(id, type) { \
> int id; \
> for (id = 0; id < game.num_unit_types; id++) { \
> struct unit_type *type = get_unit_type(id);
>
> or even something completely forward-thinking (and currently useless) like
>
> #define unit_type_iterate(type) { \
> int _id; \
> for (_id = 0; _id < game.num_unit_types; _id++) { \
> struct unit_type *type = get_unit_type(_id);
>
> ?
>
> jason
>
>
>
|
|