void CubeSession::initCommandHandlers() { #define HAND(a) commandHandlers[#a] = &CubeSession::a##Handler HAND(auth); HAND(list_rooms); HAND(get_room_info); HAND(heartbeat); #undef HAND }
IPlayer::HAND BeatLast::GetNextHand(const HandsCollection& yourHistory, const HandsCollection& oppHistory) { HAND result = GetRandomHand(); if( !oppHistory.empty() ) { result = HAND((oppHistory.back() + 1) % 3); } return result; }