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

Function testLockFacing

tests/move_route.cpp:896–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

894}
895
896void testLockFacing(lcf::rpg::EventPage::AnimType at) {
897 const MapGuard mg;
898
899 auto ch = MoveRouteVehicle();
900 ch.SetAnimationType(at);
901 auto mr = MakeRoute(static_cast<int>(lcf::rpg::MoveCommand::Code::lock_facing));
902
903 ch.ForceMoveRoute(mr, 2);
904 testMoveRoute(ch, false, 2, 0xFFFF, 0, 0, true, false, mr);
905 REQUIRE_EQ(ch.IsFacingLocked(), Game_Character::IsDirectionFixedAnimationType(at));
906
907 ForceUpdate(ch);
908 testMoveRoute(ch, false, 2, 0xFFFF + 1, 128, 1, false, false, mr);
909 REQUIRE(ch.IsFacingLocked());
910
911 mr = MakeRoute(static_cast<int>(lcf::rpg::MoveCommand::Code::unlock_facing));
912 ch.ForceMoveRoute(mr, 2);
913 testMoveRoute(ch, false, 2, 0xFFFF, 128, 0, true, false, mr);
914 REQUIRE(ch.IsFacingLocked());
915
916 ForceUpdate(ch);
917 testMoveRoute(ch, false, 2, 0xFFFF + 1, 128, 1, false, false, mr);
918 REQUIRE_EQ(ch.IsFacingLocked(), Game_Character::IsDirectionFixedAnimationType(at));
919}
920
921TEST_CASE("CommandLockFacing") {
922 for (int i = 0; i <= static_cast<int>(lcf::rpg::EventPage::AnimType_step_frame_fix); ++i) {

Callers 1

move_route.cppFile · 0.85

Calls 7

MoveRouteVehicleClass · 0.85
MakeRouteFunction · 0.85
testMoveRouteFunction · 0.85
ForceMoveRouteMethod · 0.80
IsFacingLockedMethod · 0.80
ForceUpdateFunction · 0.70
SetAnimationTypeMethod · 0.45

Tested by

no test coverage detected