123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace Facebook\WebDriver;
- class WebDriverPoint
- {
- private $x;
- private $y;
- public function __construct($x, $y)
- {
- $this->x = $x;
- $this->y = $y;
- }
-
- public function getX()
- {
- return $this->x;
- }
-
- public function getY()
- {
- return $this->y;
- }
-
- public function move($new_x, $new_y)
- {
- $this->x = $new_x;
- $this->y = $new_y;
- return $this;
- }
-
- public function moveBy($x_offset, $y_offset)
- {
- $this->x += $x_offset;
- $this->y += $y_offset;
- return $this;
- }
-
- public function equals(self $point)
- {
- return $this->x === $point->getX() &&
- $this->y === $point->getY();
- }
- }
|