17 lines
300 B
PHP
17 lines
300 B
PHP
|
<?php declare(strict_types=1);
|
||
|
|
||
|
namespace Aviat\Kilo;
|
||
|
|
||
|
class Position {
|
||
|
private function __construct(public int $x, public int $y) {}
|
||
|
|
||
|
public static function new(int $x, int $y): self
|
||
|
{
|
||
|
return new Position($x, $y);
|
||
|
}
|
||
|
|
||
|
public static function default(): self
|
||
|
{
|
||
|
return new Position(0, 0);
|
||
|
}
|
||
|
}
|