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

Method initWithAction

core/2d/ActionInterval.cpp:421–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421bool Repeat::initWithAction(FiniteTimeAction* action, unsigned int times)
422{
423 if (action && ActionInterval::initWithDuration(action->getDuration() * times))
424 {
425 _times = times;
426 _innerAction = action;
427 action->retain();
428
429 _actionInstant = dynamic_cast<ActionInstant*>(action) ? true : false;
430 // an instant action needs to be executed one time less in the update method since it uses startWithTarget to
431 // execute the action
432 // minggo: instant action doesn't execute action in Repeat::startWithTarget(), so comment it.
433 // if (_actionInstant)
434 // {
435 // _times -=1;
436 // }
437 _total = 0;
438
439 return true;
440 }
441
442 return false;
443}
444
445Repeat* Repeat::clone() const
446{

Callers 1

createMethod · 0.45

Calls 2

getDurationMethod · 0.45
retainMethod · 0.45

Tested by

no test coverage detected