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

Function testBasicSet

tests/game_character.cpp:260–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260static void testBasicSet(Game_Character& ch) {
261 ch.SetX(55);
262 REQUIRE_EQ(ch.GetX(), 55);
263
264 ch.SetY(66);
265 REQUIRE_EQ(ch.GetY(), 66);
266
267 // FIXME: Remove this method.
268 ch.SetMapId(44);
269 REQUIRE_EQ(ch.GetMapId(), 44);
270
271 ch.SetDirection(Game_Character::UpLeft);
272 REQUIRE_EQ(ch.GetDirection(), Game_Character::UpLeft);
273
274 ch.SetFacing(Game_Character::Up);
275 REQUIRE_EQ(ch.GetFacing(), Game_Character::Up);
276
277 ch.SetFacingLocked(true);
278 REQUIRE(ch.IsFacingLocked());
279
280 ch.SetLayer(2);
281 REQUIRE_EQ(ch.GetLayer(), 2);
282
283 ch.SetMoveSpeed(6);
284 REQUIRE_EQ(ch.GetMoveSpeed(), 6);
285
286 ch.SetMoveFrequency(7);
287 REQUIRE_EQ(ch.GetMoveFrequency(), 7);
288
289 // FIXME: Test move routes
290 // Should SetMoveRoute() and SetMoveRouteIndex() be public?
291 ch.SetMoveRouteIndex(3);
292 REQUIRE_EQ(ch.GetMoveRouteIndex(), 3);
293
294 ch.SetMoveRouteOverwritten(true);
295 REQUIRE(ch.IsMoveRouteOverwritten());
296
297 ch.SetSpriteGraphic("SPRITE", 8);
298 REQUIRE_EQ(ch.GetSpriteName(), "SPRITE");
299 REQUIRE_EQ(ch.GetSpriteIndex(), 8);
300 REQUIRE(!ch.HasTileSprite());
301
302 ch.SetAnimFrame(3);
303 REQUIRE_EQ(ch.GetAnimFrame(), 3);
304
305 ch.SetAnimPaused(true);
306 REQUIRE(ch.IsAnimPaused());
307
308 // FIXME: Test flashing
309 ch.SetFlashLevel(99);
310 REQUIRE_EQ(ch.GetFlashLevel(), 99);
311
312 ch.SetFlashTimeLeft(99);
313 REQUIRE_EQ(ch.GetFlashTimeLeft(), 99);
314
315 ch.SetThrough(true);
316 REQUIRE(ch.GetThrough());
317

Callers 2

testBasicSetVehicleFunction · 0.85
game_character.cppFile · 0.85

Calls 15

SetMapIdMethod · 0.80
SetDirectionMethod · 0.80
SetFacingMethod · 0.80
GetFacingMethod · 0.80
SetFacingLockedMethod · 0.80
IsFacingLockedMethod · 0.80
SetLayerMethod · 0.80
GetLayerMethod · 0.80
SetMoveSpeedMethod · 0.80
GetMoveSpeedMethod · 0.80
SetMoveFrequencyMethod · 0.80
GetMoveFrequencyMethod · 0.80

Tested by

no test coverage detected