You get the base production, in your example coins, just for having the building in your city. For each unique (different; multiples of the same building connected do not count) building from the set that touches that building, you get the additional resource/boost listed. In your example, you have two unique buildings touching the Moon Gate, so you would get the coins, Forge Points and Medals. If you put a third unique building (different from the other 3) next to it, you would also get the 10 goods. For a fourth unique building, you would also get 6 more Forge Points in addition to the first 2, for a total of 8 FP.