public function getBrowserBasedGamesData($data = null) { $out = parent::getBrowserBasedGamesData($data); $locations = array(); foreach ($this->getVillages(false) as $vil) { $loc = $vil->buildings->getTownCenterLocation(); $lkey = '#' . $loc[0] . ',' . $loc[1]; $locations[] = array('location_id' => $vil->getId(), 'location_url' => ABSOLUTE_URL . '#' . $loc[0] . ',' . $loc[1], 'name' => $vil->getName(), 'loc-x' => $loc[0], 'loc-y' => $loc[1], 'score' => $vil->getNetworth()); } $out['locations'] = $locations; return $out; }