Example #1
0
CallFuncN * CallFuncN::create(const std::function<void(Node*)> &func)
{
    auto ret = new (std::nothrow) CallFuncN();

    if (ret && ret->initWithFunction(func) ) {
        ret->autorelease();
        return ret;
    }

    CC_SAFE_DELETE(ret);
    return nullptr;
}
CallFuncNV *CallFuncNV::clone() const
{
	// no copy constructor
	auto a = new CallFuncNV();
    
    if (_functionNV) {
        a->initWithFunction(_functionNV);
    }
    
	a->autorelease();
    
	return a;
}
CallFuncNV *CallFuncNV::create(const std::function<void(Node *, Value)> &func)
{
    auto ret = new CallFuncNV();
    
    if (ret && ret->initWithFunction(func)) {
        ret->autorelease();
        
        return ret;
    }
    
    CC_SAFE_DELETE(ret);
    
    return nullptr;
}
Example #4
0
CallFuncN * CallFuncN::clone() const
{
	// no copy constructor
	auto a = new (std::nothrow) CallFuncN();

    if( _selectorTarget) {
        a->initWithTarget(_selectorTarget, _callFuncN);
    }
    else if( _functionN ){
        a->initWithFunction(_functionN);
    }

	a->autorelease();
	return a;
}
Example #5
0
CallFunc * CallFunc::clone() const
    {
    // no copy constructor
    auto a = new (std::nothrow) CallFunc();
    if( _selectorTarget) {
        a->initWithTarget(_selectorTarget);
        a->_callFunc = _callFunc;
    }
    else if( _function ){
        a->initWithFunction(_function);
    }

    a->autorelease();
    return a;
}