From 4e4b73145c84e91fa8168466dbf4aa823460858b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Wed, 9 Feb 2022 18:03:52 +0100 Subject: [PATCH] - Added iteration macro for city counters --- common/counters.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/counters.h b/common/counters.h index ec7c1a3683..9f89ea0a74 100644 --- a/common/counters.h +++ b/common/counters.h @@ -48,6 +48,15 @@ int counter_index(struct counter *pcount); struct counter *counter_by_index(int index, enum counter_target target); int counters_get_city_counters_count(void); + +#define city_counters_iterrate(pcount) { \ + int _i; \ + for (_i = 0; _i < counters_get_city_counters_count(); _i++) { \ + pcount = counter_by_index(_i, CTGT_CITY); + +#define city_counters_iterrate_end } \ + } + #ifdef __cplusplus } #endif /* __cplusplus */ -- 2.35.1