Daniel Maixner 29ffd6f09c Tuning
2022-09-23 15:41:27 +02:00

27 lines
722 B
PHP

<?php
use cs\Core\Game;
use cs\Core\GameState;
use cs\Core\Point;
use Test\Simulation\SimulationTester;
return new class extends SimulationTester {
public function onTickEnd(GameState $state, int $tick): void
{
$pp = $state->getPlayer(1)->getPositionImmutable();
if ($pp->y === 0 && $pp->x > 1156 && $pp->x < 1270 && $pp->z < 80) {
$this->fail("Inside Box, tick: $tick");
}
if ($pp->y === 0 && $pp->x === 1245 && $pp->z === 50) {
$this->fail("Inside Box, tick: $tick");
}
}
public function onGameEnd(Game $game): void
{
$this->assertPositionSame(new Point(1483, 0, 45), $game->getPlayer(1)->getPositionImmutable());
}
};