Ability to foreach action in accelerator map.

This commit is contained in:
and3md 2017-09-21 18:31:08 +02:00
parent 1c3a759cf7
commit ee28496955
1 changed files with 12 additions and 0 deletions

View File

@ -613,6 +613,18 @@ struct ActionMap {
}
return null;
}
int opApply(int delegate(ref Action) op) {
int result = 0;
foreach (ref Accelerator acc; _map.byKey) {
result = op(_map[acc]);
if (result)
break;
}
return result;
}
}
/// List of Actions, for looking up Action by key