The hawk-dove game as an average cost problem