1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-29 19:40:35 +00:00

added IF_MAP_CONTAINS_KEY macro

This commit is contained in:
Zeno Rogue 2021-07-18 11:53:18 +02:00
parent cebb0180a5
commit ef8b24ff2a

View File

@ -575,6 +575,11 @@ typedef function<int(struct cell*)> cellfunction;
#define forCellCM(ct, cf) forCellIdCM(ct,forCellCM ## __LINE__,cf)
#define forCellAll(ct, cf) forCellIdCM(ct,forCellAll ## __LINE__,cf)
/* conditions */
/** `IF_MAP_CONTAINS_KEY(it, map, key) statement` checks whether the map 'map' contain key 'key', and if so, executes statement with it set to the relevant iterator */
#define IF_MAP_CONTAINS_KEY(it, map, key) for(auto it = map.find(key); it != map.end(); it = map.end())
// canAttack/moveval flags
#define AF_NORMAL 0 // nothing special about this attack