Look at it: it's just a nested conditional.
a == player_ ? a : (b == player_ ? b : 0)
If a == player_ then it returns a.
Otherwise if b == player_ then it returns b.
If both tests fail it returns 0
Think of it as an "in place if":
if (a == player_)
return a;
else if (b == player_)
return b;
return 0;