39 lines
1007 B
JavaScript
39 lines
1007 B
JavaScript
|
|
Potree.Version = function(version){
|
|
this.version = version;
|
|
var vmLength = (version.indexOf(".") === -1) ? version.length : version.indexOf(".");
|
|
this.versionMajor = parseInt(version.substr(0, vmLength));
|
|
this.versionMinor = parseInt(version.substr(vmLength + 1));
|
|
if(this.versionMinor.length === 0){
|
|
this.versionMinor = 0;
|
|
}
|
|
|
|
};
|
|
|
|
Potree.Version.prototype.newerThan = function(version){
|
|
var v = new Potree.Version(version);
|
|
|
|
if( this.versionMajor > v.versionMajor){
|
|
return true;
|
|
}else if( this.versionMajor === v.versionMajor && this.versionMinor > v.versionMinor){
|
|
return true;
|
|
}else{
|
|
return false;
|
|
}
|
|
};
|
|
|
|
Potree.Version.prototype.equalOrHigher = function(version){
|
|
var v = new Potree.Version(version);
|
|
|
|
if( this.versionMajor > v.versionMajor){
|
|
return true;
|
|
}else if( this.versionMajor === v.versionMajor && this.versionMinor >= v.versionMinor){
|
|
return true;
|
|
}else{
|
|
return false;
|
|
}
|
|
};
|
|
|
|
Potree.Version.prototype.upTo = function(version){
|
|
return !this.newerThan(version);
|
|
}; |