radius(0))->toBe(6.0) ->and($ring->radius(100))->toEqualWithDelta(6 + sqrt(100 / (M_PI * 0.08)), 1e-9) ->and($ring->radius(1000))->toBeGreaterThan($ring->radius(100)); }); it('picks a field on the ring', function () { // Angle 0 and no offset: straight east of the centre at the start radius. expect((new SpawnRing(gameConfig()))->pick(0, [], sequence(0.0, 0.5)))->toBe([506, 500]); }); it('never picks a field next to another village', function () { $ring = new SpawnRing(gameConfig()); expect($ring->pick(0, ['507|501' => true], sequence(0.0, 0.5)))->toBeNull() ->and($ring->pick(0, ['508|502' => true], sequence(0.0, 0.5)))->toBe([506, 500]); });