test

Lugo4PHP

Ball

Classe que representa uma bola.

getPosition(): Point

Retorna a posição atual da bola.

$ball->getPosition();

getVelocity(): Velocity

Retorna a velocity atual da bola.

$ball->getVelocity();

getDirection(): Vector2D

Retorna a direção atual da bola.

$ball->getDirection();

getSpeed(): float

Retorna a velocidade atual da bola.

$ball->getSpeed();

hasHolder(): bool

Retorna verdadeiro se a bola está com algum jogador.

$ball->hasHolder();

holderIs(Player $holder): bool

Retorna verdadeiro se a bola está sendo segura por algum jogador e ele for o jogador dado.

$ball->holderIs($player);

directionToPlayer(Player $player): Vector2D

Retorna a direção que a bola precisa se dirigir para ir em direção ao jogador X.

$ball->directionToPlayer($player);

distanceToPlayer(Player $player): float

Retorna a distância entre a bola e o jogador X.

$ball->distanceToPlayer($player);

directionToPoint(Point $point): Vector2D

Retorna a direção que a bola precisa se dirigir para ir em direção a um ponto.

$ball->directionToPoint($point);

distanceToPoint(Point $point): float

Retorna a distância entre a bola e um ponto.

$ball->distanceToPoint($point);

directionToRegion(IRegion $region): Vector2D

Retorna a direção que a bola precisa se dirigir para ir em direção ao centro de uma região.

$ball->directionToRegion($region);

distanceToRegion(IRegion $region): float

Retorna a distância entre a bola e o centro de uma região.

$ball->distanceToRegion($region);

Métodos

getPosition(): Point;
getVelocity(): Velocity;
getDirection(): Vector2D;
getSpeed(): float;
hasHolder(): bool;
getHolder(): ?Player;
holderIs(Player $holder): bool;
 
directionToPlayer(Player $player): Vector2D;
directionToPoint(Point $point): Vector2D;
directionToRegion(IRegion $region): Vector2D;
distanceToPlayer(Player $player): float;
distanceToPoint(Point $point): float;
distanceToRegion(IRegion $region): float;

On this page