Integrating resource defence theory with a neural nonapeptide pathway to explain territory-based mating systems