コード例 #1
0
ファイル: CCNode.cpp プロジェクト: khanhbui/ThreeDots
Node::~Node()
{
    CCLOGINFO( "deallocing Node: %p - tag: %i", this, _tag );
    
#if CC_ENABLE_SCRIPT_BINDING
    if (_updateScriptHandler)
    {
        ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler);
    }
#endif

    CC_SAFE_RELEASE(_actionManager);
    CC_SAFE_RELEASE(_scheduler);
    
    _eventDispatcher->removeEventListenersForTarget(this);
    CC_SAFE_RELEASE(_eventDispatcher);
    
    // attributes
    CC_SAFE_RELEASE(_shaderProgram);
    CC_SAFE_RELEASE(_userObject);

    for (auto& child : _children)
    {
        child->_parent = nullptr;
    }

    removeAllComponents();
    
    CC_SAFE_DELETE(_componentContainer);
    
#if CC_USE_PHYSICS
    setPhysicsBody(nullptr);
#endif
}
コード例 #2
0
 void circle::makeCurrentCircle() {
      // Make the figure represent the current circle.
      
        removeAllComponents();
        insertArc(currentX, currentY, currentR, 0.0, 360.0);
      
 }
コード例 #3
0
ファイル: CCNode.cpp プロジェクト: solkar/LD29
Node::~Node()
{
    CCLOGINFO( "deallocing Node: %p - tag: %i", this, _tag );
    
#if CC_ENABLE_SCRIPT_BINDING
    if (_updateScriptHandler)
    {
        ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler);
    }
#endif

    // User object has to be released before others, since userObject may have a weak reference of this node
    // It may invoke `node->stopAllAction();` while `_actionManager` is null if the next line is after `CC_SAFE_RELEASE_NULL(_actionManager)`.
    CC_SAFE_RELEASE_NULL(_userObject);
    
    // attributes
    CC_SAFE_RELEASE_NULL(_shaderProgram);

    for (auto& child : _children)
    {
        child->_parent = nullptr;
    }

    removeAllComponents();
    
    CC_SAFE_DELETE(_componentContainer);
    
#if CC_USE_PHYSICS
    setPhysicsBody(nullptr);

#endif
    
    CC_SAFE_RELEASE_NULL(_actionManager);
    CC_SAFE_RELEASE_NULL(_scheduler);
    
    _eventDispatcher->removeEventListenersForTarget(this);
    
#if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS && COCOS2D_DEBUG > 0
    _eventDispatcher->debugCheckNodeHasNoEventListenersOnDestruction(this);
#endif

    CCASSERT(!_running, "Node still marked as running on node destruction! Was base class onExit() called in derived class onExit() implementations?");
    CC_SAFE_RELEASE(_eventDispatcher);
}
コード例 #4
0
ComponentManager::~ComponentManager()
{
	removeAllComponents();
	m_pWorkingNode = nullptr;
}
コード例 #5
0
ファイル: Test_Entities.cpp プロジェクト: 11011001/anax
	},
	
	"Removing components", []
	{
		anax::World world;
		
		auto e = world.createEntity();
		e.addComponent<PositionComponent>();
		e.removeComponent<PositionComponent>();
		
		EXPECT(!e.hasComponent<PositionComponent>());
	},
	
	"Removing all components", []
	{
		anax::World world;
		
		auto e = world.createEntity();
		e.addComponent<PositionComponent>();
		e.addComponent<VelocityComponent>();
		
		e.removeAllComponents();
		
		EXPECT(!e.hasComponent<PositionComponent>() && !e.hasComponent<VelocityComponent>());
	}
};

int main()
{
	return lest::run(specification);
}