[Freeciv-Dev] (PR#2715) introducing tech_type_iterate
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
[jdorje - Sat Jan 4 06:25:45 2003]:
> After the patch to add tech graphics to the client, I noticed (again)
> that several desirable iterators are missing. One of them is
> tech_type_iterate, which is provided by the attached patch.
After the other work on the tech code, here is a new version of this
patch. A_NONE (aka A_ROOT==0) is now covered by the iterator. Note
that A_FUTURE is not.
Most loops already included A_NONE in the iteration. Here it is obvious
that the new code is correct.
In other places A_NONE was excluded. Here I have either satisfied
myself that it is fine to include it in the loop (e.g., the
tech-stealing and tech-transfer code) or specifically excluded it (e.g.,
the helptext code).
Some loops still remain and go all the way through A_LAST. I have the
feeling that the packet and packhand loops should use tech_type_iterate
as well, but that's a bigger issue.
I also have the feeling A_FUTURE should be included in the loop somehow
- most loops would unaffected by it just as they are by A_NONE, but it
might enable the removing of some special cases.
Finally, I think tech_type_iterate should iterate over a struct advance
*, not a Tech_Type_id. But this is infeasible since there's currently
no clean way to find the ID (used by most operations) from the structure
pointer.
jason
- [Freeciv-Dev] (PR#2715) introducing tech_type_iterate,
Jason Short <=
|
|