The Danish toy giant announced the deal to buy the Lego and Legoland branded discovery centres by the end of the year.