18 lines
356 B
PHP
18 lines
356 B
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
namespace App\Game\Map;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Continents are 100 × 100 blocks named by their y and x hundreds, as in Die Stämme:
|
|||
|
|
* 500|500 lies in K55, 123|456 in K41.
|
|||
|
|
*/
|
|||
|
|
final class Continent
|
|||
|
|
{
|
|||
|
|
public const SIZE = 100;
|
|||
|
|
|
|||
|
|
public static function of(int $x, int $y): string
|
|||
|
|
{
|
|||
|
|
return 'K'.intdiv($y, self::SIZE).intdiv($x, self::SIZE);
|
|||
|
|
}
|
|||
|
|
}
|