Discrete Games in Endogenous Networks: Theory and Policy