<?
require_once("LenexBase.class.php");
define ("LENEX_POOL_TYPE_UNKNOWN","");
define ("LENEX_POOL_TYPE_INDOOR","INDOOR");
define ("LENEX_POOL_TYPE_OUTDOOR","OUTDOOR");
define ("LENEX_POOL_TYPE_LAKE","LAKE");
define ("LENEX_POOL_TYPE_OCEAN","OCEAN");
class LenexPool extends LenexBase {
var $name="";
var $laneMax=0;
var $laneMin=0;
var $temperature="";
var $type=LENEX_POOL_TYPE_UNKNOWN;
function LenexPool($name,$laneMin=0,$laneMax=0,$temperature="",$type=LENEX_POOL_TYPE_UNKNOWN) {
$this->name=$name;
$this->laneMax=$laneMax;
$this->laneMin=$laneMin;
$this->temperature=$temperature;
$this->type=$type;
}
/*static*/
function fromSAX($attrs) {
$obj =& new LenexPool(@$attrs["NAME"],@$attrs["LANEMIN"],@$attrs["LANEMAX"],@$attrs["TEMPERATURE"],@$attrs["TYPE"]);
return $obj;
}
/*override*/
function setParent(&$obj) {
$obj->setPool($this);
}
function getNumberOfLanes() {
return (min($this->laneMax,$this->laneMin)<1) || ($this->laneMax<$this->laneMin)? 0 : max(0,$this->laneMax-$this->laneMin+1);
}
}
?>