* @return bool true if the place exists ; otherwise, false.
*
* @todo handles alias
*/
functionexists(){
$n=count($this->data);
//If not defined, it doesn't exist
if($n==0)returnfalse;
//Checks global location
switch($this->data[0][0]){
case'B':
switch(strlen($this->data[0])){
case9:
if(!$place=GeoPlace::from_code($this->data[0]))
returnfalse;
break;
case6:
$body=newGeoBody(substr($this->data[0],1));
if($body->lastError)returnfalse;
break;
default:
message_die(GENERAL_ERROR,"Invalid global location expression size: ".$this->data[0],"GeoLocation exists method",__LINE__,__FILE__);
}
break;
case'S':
$ship=newShip(substr($this->data[0],1));
if($body->lastError)returnfalse;
break;
default:
message_die(GENERAL_ERROR,"Invalid global location expression size: ".$this->data[0],"GeoLocation exists method",__LINE__,__FILE__);
returnfalse;
}
if($n>1){
if(!isset($place)){
message_die(GENERAL_ERROR,"Can't check if a local place exists for the following location: ".$this->data[0],"GeoLocation exists method",__LINE__,__FILE__);