TrackManiaControl/application/core/manialinkIdHandler.php

39 lines
691 B
PHP
Raw Normal View History

2013-11-09 11:06:04 +01:00
<?php
2013-11-09 12:20:38 +01:00
namespace ManiaControl;
2013-11-09 11:06:04 +01:00
/**
* Class manialinkidHandler handles manialink id's
*
* @author Lukas Kremsmayr and steeffeen
*/
class ManialinkIdHandler {
2013-11-09 12:20:38 +01:00
/**
* Private properties
*/
private $maniaLinkIdCount;
2013-11-09 11:06:04 +01:00
2013-11-09 12:20:38 +01:00
public function __construct(){
$maniaLinkIdCount = 0;
}
/**
* Reservses manialinks for a plugin
*
* @param int $count
* @return array with manialink Ids
*/
public function reserveManiaLinkIds($count){
$mlIds = array();
for($i = 0; $i < $count; $i++){
$mlIds[0] = $i + $this->maniaLinkIdCount;
}
$this->maniaLinkIdCount += $count;
return $mlIds;
}
2013-11-09 11:06:04 +01:00
}
?>