Obviously the only way is to buy one of each sub category of bike.
XC bike
Enduro bike
Trail bike
Downhill bike
Downcountry bike
Dirt Jump bike
Have a 27.5 and 29er wheel version of each to be sure.
This way you can ensure you're always in that Goldilocks zone.
This is probably the best buyers guide I've ever read