Merge pull request #1649 from PEMapModder/patch-2

Added doccomment for Vector3::add() and Vector3::subtract()
This commit is contained in:
Shoghi Cervantes 2014-07-13 12:26:46 +02:00
commit 4a615f03b5

View File

@ -80,6 +80,11 @@ class Vector3{
return $this->z;
}
/**
* @param Vector3|int $x
* @param int $y
* @param int $z
*/
public function add($x, $y = 0, $z = 0){
if($x instanceof Vector3){
return $this->add($x->x, $x->y, $x->z);
@ -88,6 +93,12 @@ class Vector3{
}
}
/**
* @param Vector3|int $x
* @param int $y
* @param int $z
* @return Vector3
*/
public function subtract($x = 0, $y = 0, $z = 0){
if($x instanceof Vector3){
return $this->add(-$x->x, -$x->y, -$x->z);
@ -190,4 +201,4 @@ class Vector3{
return "Vector3(x=" . $this->x . ",y=" . $this->y . ",z=" . $this->z . ")";
}
}
}