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

Function testPlayer

tests/game_character_moveto.cpp:46–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46static void testPlayer(Game_Player& ch) {
47 ch.SetRemainingStep(256);
48 ch.SetJumping(true);
49 ch.SetStopCount(77);
50 ch.SetMaxStopCount(88);
51 ch.SetAnimCount(9);
52 ch.SetAnimFrame(2);
53 ch.SetTransparency(7);
54 ch.SetSpriteGraphic("GRAPHIC", 1);
55
56 ch.SetTotalEncounterRate(50);
57 ch.SetMenuCalling(true);
58 ch.SetEncounterCalling(true);
59
60 ch.MoveTo(static_cast<int>(map_id), 2, 3);
61
62 testChar(ch, 1, 2, 3, 0, true, 77, 88, 9, 2, "", 0);
63
64 REQUIRE_EQ(ch.GetTotalEncounterRate(), 0);
65 REQUIRE_EQ(ch.GetTransparency(), 0);
66 REQUIRE(!ch.IsMenuCalling());
67
68 // This flag is not cleared.
69 REQUIRE(ch.IsEncounterCalling());
70}
71
72template <typename T>
73static void testNonPlayer(T& ch) {

Callers 1

Calls 15

SetRemainingStepMethod · 0.80
SetJumpingMethod · 0.80
SetStopCountMethod · 0.80
SetMaxStopCountMethod · 0.80
SetAnimCountMethod · 0.80
SetAnimFrameMethod · 0.80
SetTransparencyMethod · 0.80
SetSpriteGraphicMethod · 0.80
SetTotalEncounterRateMethod · 0.80
SetMenuCallingMethod · 0.80
SetEncounterCallingMethod · 0.80
GetTotalEncounterRateMethod · 0.80

Tested by

no test coverage detected