Forum Discussion
ffi82
6 months agoSeasoned Scout
found a workaround... (i love proxies... :( )... works for CY, CC, DHQ and DF this way...
proper fix would be nice though... or is this a "feature" ? :P
const buildings = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity().get_Buildings().d;
const getLevel = name => Object.values(buildings).find(b => b.get_TechGameData_Obj().dn === name)?.get_CurrentLevel();
const obj = {
levelCY: getLevel('Construction Yard'),
levelCC: getLevel('Command Center'),
levelDHQ: getLevel('Defense HQ'),
levelDF: getLevel('Defense Facility')
};
console.log(obj);