begin Maplist widget

This commit is contained in:
kremsy
2013-12-14 22:00:59 +01:00
parent a1104c327a
commit 6bb13fb2df
7 changed files with 214 additions and 6 deletions

View File

@@ -149,7 +149,18 @@ class MapManager implements CallbackListener {
if (!$map) {
return;
}
$this->addMap($map);
$this->addMap($map); //TODO needed?
//var_dump($map);
//add Maplist on Init once
if(!$this->maniaControl->client->query('GetMapList', 100,0)){ //fetch 100 maps, first map is always current map
trigger_error("Couldn't fetch mapList. " . $this->maniaControl->getClientErrorText());
return null;
}
$mapList = $this->maniaControl->client->getResponse();
foreach($mapList as $rpcMap){
$map = new Map($this->maniaControl, $rpcMap);
$this->addMap($map);
}
}
/**
@@ -163,5 +174,16 @@ class MapManager implements CallbackListener {
return;
}
$this->addMap($map);
//TODO restrucutre, make current as first
}
/**
* @return array
*/
public function getMapList(){
return $this->mapList;
}
}