class Center implements PointInterface

Center point of a box.

Methods

__construct(BoxInterface $box)

Constructs coordinate with size instance, it needs to be relative to.

int
getX()

Gets points x coordinate.

int
getY()

Gets points y coordinate.

bool
in(BoxInterface $box)

Checks if current coordinate is inside a given box.

move(int $amount)

Returns another point, moved by a given amount from current coordinates.

string
__toString()

Gets a string representation for the current point.

Details

at line 33
__construct(BoxInterface $box)

Constructs coordinate with size instance, it needs to be relative to.

Parameters

BoxInterface $box

at line 43
int getX()

Gets points x coordinate.

Return Value

int

See also

PointInterface::getX

at line 53
int getY()

Gets points y coordinate.

Return Value

int

See also

PointInterface::getY

at line 63
bool in(BoxInterface $box)

Checks if current coordinate is inside a given box.

Parameters

BoxInterface $box

Return Value

bool

See also

PointInterface::in

at line 73
PointInterface move(int $amount)

Returns another point, moved by a given amount from current coordinates.

Parameters

int $amount

Return Value

PointInterface

See also

PointInterface::move

at line 83
string __toString()

Gets a string representation for the current point.

Return Value

string

See also

PointInterface::__toString