you would have to add two int variables to CvCity to store it. then a function run in Cvcity::doturn to calculate it. also the variable would need to be applied, probably look at the code for happinessfromfeatures (not sure the exact name).
and last thing you could add some code for display, again happinessfromfeatures could serve as an example.