MCPcopy Create free account
hub / github.com/EasyRPG/Player / testTurn

Function testTurn

tests/move_route.cpp:449–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447
448
449static void testTurn(lcf::rpg::MoveCommand::Code code, int orig_dir, int dir, int face, int x = 0, int y = 0, int px = 0, int py = 0) {
450 Main_Data::game_player->SetX(px);
451 Main_Data::game_player->SetY(py);
452
453 auto ch = MoveRouteVehicle();
454 ch.SetX(x);
455 ch.SetY(y);
456 ch.SetDirection(orig_dir);
457 ch.SetFacing(orig_dir);
458 auto mr = MakeRoute(static_cast<int>(code));
459
460 CAPTURE(code);
461 CAPTURE(orig_dir);
462 CAPTURE(dir);
463 CAPTURE(face);
464 CAPTURE(x);
465 CAPTURE(y);
466 CAPTURE(px);
467 CAPTURE(py);
468
469 ch.ForceMoveRoute(mr, 2);
470 testMoveRouteDir(ch, orig_dir, orig_dir, false, 2, 0xFFFF, 0, 0, true, false, mr);
471
472 for(int i = 1; i <= 64; ++i) {
473 ForceUpdate(ch);
474 testMoveRouteDir(ch, dir, face, false, 2, i, 64, 1, true, false, mr);
475 }
476
477 ForceUpdate(ch);
478 testMoveRouteDir(ch, dir, face, false, 2, 65, 128, 1, false, false, mr);
479}
480
481TEST_CASE("CommandTurn") {
482 const MapGuard mg;

Callers 1

move_route.cppFile · 0.85

Calls 9

MoveRouteVehicleClass · 0.85
MakeRouteFunction · 0.85
testMoveRouteDirFunction · 0.85
SetDirectionMethod · 0.80
SetFacingMethod · 0.80
ForceMoveRouteMethod · 0.80
ForceUpdateFunction · 0.70
SetXMethod · 0.45
SetYMethod · 0.45

Tested by

no test coverage detected