16.03.2016, 00:12
I'm a bit unsure of the function's purpose, but my suggestion was not related to performance.
I mean you could do something like this:
I mean you could do something like this:
pawn Код:
enum (<<= 1) {
INVALID_BAN_TYPE = 0b000,
PSEUDO_BAN_TYPE = 0b001,
IP_BAN_TYPE // 0b010
}
stock Ban(ban_type) {
if (ban_type & PSEUDO_BAN_TYPE) {
DoPseudoBan(...);
}
if (ban_type & IP_BAN_TYPE) {
DoIpBan(...);
}
}
// only IP ban
Ban(IP_BAN_TYPE);
// this is the "twice" type
Ban(PSEUDO_BAN_TYPE | IP_BAN_TYPE);