A Unified Theory of Basketball