Add or replace class methods?

I tried doing so a few months ago but couldn't figure out how. If anyone knows, it would be helpful. For example... changing a function like shown below.

PHP:
function City_GetNumBuildingClass(city, buildingClass)
  return City_GetNumBuilding(city, Player_GetUniqueBuildingID(Players[city:GetOwner()], buildingClass))
end
It's a small difference, but would make the code more organized for each of those functions to be a part of their respective classes. I just can't figure out how.
PHP:
City_GetNumBuildingClass(city, buildingClass)
|
v
city:GetNumBuildingClass(buildingClass)
 
Back
Top Bottom