You start with the most specific first since the logic starts from the top to the bottom of the list. In this case you would need to check for both A and B to start, followed by the other checks which do not depend on multiple conditions.
if (A && B) {}
else if (A || B) {}
else {}
if you need to know difference between A and B
if (A && B) {}
else if (A) {}
else if (B) {}
else {}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…