Two-player game structures for generalized planning and agent composition