MapManager add Method getMapByIndex

This commit is contained in:
kremsy 2017-03-12 11:26:20 +01:00
parent c325f571eb
commit adc4753fe4

View File

@ -715,6 +715,21 @@ class MapManager implements CallbackListener, CommunicationListener {
return true;
}
/**
* Returns the Map by it's given Array Index
*
* @param int $index The index starts at 0
* @return Map|null
*/
public function getMapByIndex($index) {
$maps = $this->getMaps();
if ($index > sizeof($maps)) {
return null;
} else {
return $maps[$index];
}
}
/**
* Returns the MapIndex of a given map
*