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

Method initWithTwoActions

core/2d/ActionInterval.cpp:240–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240bool Sequence::initWithTwoActions(FiniteTimeAction* actionOne, FiniteTimeAction* actionTwo)
241{
242 AXASSERT(actionOne != nullptr, "actionOne can't be nullptr!");
243 AXASSERT(actionTwo != nullptr, "actionTwo can't be nullptr!");
244 if (actionOne == nullptr || actionTwo == nullptr)
245 {
246 AXLOGE("Sequence::initWithTwoActions error: action is nullptr!!");
247 return false;
248 }
249
250 float d = actionOne->getDuration() + actionTwo->getDuration();
251 ActionInterval::initWithDuration(d);
252
253 _actions[0] = actionOne;
254 actionOne->retain();
255
256 _actions[1] = actionTwo;
257 actionTwo->retain();
258
259 return true;
260}
261
262bool Sequence::isDone() const
263{

Callers 1

createWithTwoActionsMethod · 0.80

Calls 3

createFunction · 0.85
getDurationMethod · 0.45
retainMethod · 0.45

Tested by

no test coverage detected