On 7 February 2016 at 16:36, Robert Finch <[email protected]> wrote:
>
>
> Is there an easy way to get a list of resources available in the game ?
>
>
>
> The only way I can see to do it, is to iterate through all the tiles in the
> game, figure out all the different terrains, and then iterate through all
> the different terrains to identify the resources. It’s be a lot easier if
> there was a resource list somewhere.

 In case of TRUNK,

extra_type_by_cause_iterate(EC_RESOURCE, presource_extra) {
  /* Your code here */
} extra_type_by_cause_iterate_end;

 might be what you are looking for.

 In 'EC_RESOURCE', C specifically stands for "C)ause of the extra
being placed on the map" -> EC_RESOURCE is something that map
generator places as Resource. Probably not relevant for your case, but
note that this works only once the 'list of resources specific to a
cause' have been set up. Otherwise you need to do slower

 extra_type_iterate(pextra) {
   if (is_extra_caused_by(pextra, EC_RESOURCE) {
     /* Your code here */
   }
 } extra_type_iterate_end;

 Note2: Client sets up these lists independently


 Older branches have

 resource_type_iterate(presource) {
 } resource_type_iterate_end;


> Clustering breaks the network packet compatibility because the cluster field
> is added.

 Update protocol capability string in fc_version so that incompatible
server/client know that they are incompatible. Current policy is to
consider this trivially acceptable in development branches. We
sometimes do that several times in a single day. Only once branch has
reached network protocol freeze, we have to make such updates not to
cause hard compatibility break, meaning a bit more work as it then
needs to be implemented as optional capability.



 - ML

_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to