MCPcopy Create free account
hub / github.com/axmolengine/axmol / SchedulerCallbackTest

Method SchedulerCallbackTest

tests/cpp-tests/Source/NodeTest/NodeTest.cpp:414–435  ·  view source on GitHub ↗

------------------------------------------------------------------ SchedulerCallbackTest ------------------------------------------------------------------

Source from the content-addressed store, hash-verified

412//
413//------------------------------------------------------------------
414SchedulerCallbackTest::SchedulerCallbackTest()
415{
416 auto node = Node::create();
417 addChild(node, 0);
418 node->setName("a node");
419
420 _total = 0;
421 node->schedule(
422 [&](float dt) {
423 _total += dt;
424 AXLOGD("hello world: {} - total: {}", dt, _total);
425 },
426 0.5, "some_key");
427
428 node->scheduleOnce(
429 [&](float dt) {
430 // the local variable "node" will go out of scope, so I have to get it from "this"
431 auto anode = this->getChildByName("a node");
432 anode->unschedule("some_key");
433 },
434 5, "ignore_key");
435}
436
437void SchedulerCallbackTest::onEnter()
438{

Callers

nothing calls this directly

Calls 6

createFunction · 0.85
scheduleOnceMethod · 0.80
setNameMethod · 0.45
scheduleMethod · 0.45
getChildByNameMethod · 0.45
unscheduleMethod · 0.45

Tested by

no test coverage detected