MapManager add Method getMapByIndex
This commit is contained in:
parent
c325f571eb
commit
adc4753fe4
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user