/** ** __construct The default constructor ** ** Parameters: ** - id: This location UNIQUE identifier ** - corner1: Top-left corner of this location in the map ** - corner2: Bottom-right corner of this location in the map ** - edge: Size of each area sectors edge ** - parent: Parent location of this location (usually Location0) ** - start: Initial position for players moved to this location ** - interior: Interior ID for this location ** - vworld: Virtual world for this location **/ public function __construct($id, Position $corner1, Position $corner2, $edge, Position $start, Location $parent = null, $sight = -1, $interior = 0, $vworld = 0) { $this->id = (int) $id; $this->parent = $parent; if ($parent) { $parent->AddChild($this); } Locations::Add($this); $this->area = new Area($this, $corner1, $corner2, $edge); if ($start == null) { $this->start = new Position(0, 0, 0, 0); } else { $this->start = $start; } $this->interior = $interior; $this->vworld = $vworld; $this->sight = $sight; $this->bounds['min'] = new Position(-40000, -40000); $this->bounds['max'] = new Position(40000, 40000); }