Ejemplo n.º 1
0
void LayerTest::nextCallback(Object* sender)
{
    auto s = new LayerTestScene();
    s->addChild( nextAction() );
    Director::getInstance()->replaceScene(s);
    s->release();
}
Ejemplo n.º 2
0
void NetworkTestScene::runThisTest()
{
    sceneIdx = -1;
    addChild(nextAction());

    CCDirector::sharedDirector()->replaceScene(this);
}
Ejemplo n.º 3
0
void ShaderTestDemo::nextCallback(CCObject* pSender)
{
    CCScene* s = new ShaderTestScene();//CCScene::create();
    s->addChild( nextAction() );
    CCDirector::sharedDirector()->replaceScene(s);
    s->release();
}
Action SMDPAgent::step(double reward, const State &state, std::ostream &output)
{
	giveReward(reward, output);
	Action action = nextAction(state, output);
	applyAction(action, output);
	return action;
}
Action SMDPAgent::startEpisode(const State &state, std::ostream &output)
{
	initialize(output);
	Action action = nextAction(state, output);
	applyAction(action, output);
	return action;
}
Ejemplo n.º 6
0
void SpriteDemo::nextCallback(CCObject* pSender)
{
    CCScene* s = new ProgressActionsTestScene();
    s->addChild( nextAction() );
    CCDirector::sharedDirector()->replaceScene(s);
    s->release();
}
Ejemplo n.º 7
0
void ConfigurationTestScene::runThisTest()
{
    sceneIdx = -1;
    addChild(nextAction());

    Director::sharedDirector()->replaceScene(this);
}
Ejemplo n.º 8
0
void BaseClippingNodeTest::nextCallback(CCObject* sender)
{
	CCScene *s = new ClippingNodeTestScene();
	s->addChild(nextAction());
	CCDirector::sharedDirector()->replaceScene(s);
    s->release();
}
Ejemplo n.º 9
0
void UnitTestDemo::nextCallback(Ref* sender)
{
    auto s = new UnitTestScene();
    s->addChild( nextAction() );
    Director::getInstance()->replaceScene(s);
    s->release();
}
Ejemplo n.º 10
0
void BaseClippingNodeTest::nextCallback(Ref* sender)
{
	Scene *s = new ClippingNodeTestScene();
	s->addChild(nextAction());
	Director::getInstance()->replaceScene(s);
    s->release();
}
Ejemplo n.º 11
0
void ShaderTestDemo::nextCallback(Ref* sender)
{
    auto s = new (std::nothrow) ShaderTestScene();//CCScene::create();
    s->addChild( nextAction() );
    Director::getInstance()->replaceScene(s);
    s->release();
}
Ejemplo n.º 12
0
///---------------------------------------
//
// ShaderTestScene
// 
///---------------------------------------
void ShaderTestScene::runThisTest()
{
    sceneIdx = -1;
    addChild(nextAction());

    Director::getInstance()->replaceScene(this);
}
Ejemplo n.º 13
0
void NetworkDemo::nextCallback(CCObject* pSender)
{
    CCScene* s = new NetworkTestScene();
    s->addChild( nextAction() );
    CCDirector::sharedDirector()->replaceScene(s);
    s->release();
}
Ejemplo n.º 14
0
void ConfigurationBase::nextCallback(Object* pSender)
{
    Scene* s = new ConfigurationTestScene();
    s->addChild( nextAction() );
    Director::sharedDirector()->replaceScene(s);
    s->release();
}
void ConfigurationBase::nextCallback(Object* sender)
{
    auto s = new ConfigurationTestScene();
    s->addChild( nextAction() );
    Director::getInstance()->replaceScene(s);
    s->release();
}
Ejemplo n.º 16
0
void FileUtilsTestScene::runThisTest()
{
    CCLayer* pLayer = nextAction();
    addChild(pLayer);
    
    CCDirector::sharedDirector()->replaceScene(this);
}
Ejemplo n.º 17
0
void FileUtilsDemo::nextCallback(CCObject* pSender)
{
    CCScene* pScene = new FileUtilsTestScene();
    CCLayer* pLayer = nextAction();
    
    pScene->addChild(pLayer);
    CCDirector::sharedDirector()->replaceScene(pScene);
    pScene->release();
}
Ejemplo n.º 18
0
void XxxForm::createActions(void) {
	connect(statusTimer, SIGNAL(timeout()), this, SLOT(timerStatusAction()));

	connect(nextPushButton, SIGNAL(released()), this, SLOT(nextAction()));
	connect(previousPushButton, SIGNAL(released()), this,
			SLOT(previousAction()));

	connect(savePushButton, SIGNAL(released()), this, SLOT(saveAction()));
	connect(saveAndContinueSavingPushButton, SIGNAL(released()), this, SLOT(
			saveAndContinueSavingAction()));
	connect(removePushButton, SIGNAL(released()), this, SLOT(removeAction()));
	connect(cancelPushButton, SIGNAL(released()), this, SLOT(cancelAction()));
}
Ejemplo n.º 19
0
void FontTest::nextCallback(CCObject* pSender)
{
    showFont(nextAction());
}
Ejemplo n.º 20
0
void FontTest::nextCallback(Ref* sender)
{
    showFont(nextAction());
}
Ejemplo n.º 21
0
void CupsAddSmb::slotReceived(TDEProcess*, char *buf, int buflen)
{
	TQString	line;
	int		index(0);
	bool	partial(false);
	static bool incomplete(false);

	kdDebug(500) << "slotReceived()" << endl;
	while (1)
	{
		// read a line
		line = TQString::fromLatin1("");
		partial = true;
		while (index < buflen)
		{
			TQChar	c(buf[index++]);
			if (c == '\n')
			{
				partial = false;
				break;
			}
			else if (c.isPrint())
				line += c;
		}

		if (line.isEmpty())
		{
			kdDebug(500) << "NOTHING TO READ" << endl;
			return;
		}

		kdDebug(500) << "ANSWER = " << line << " (END = " << line.length() << ")" << endl;
		if (!partial)
		{
			if (incomplete && m_buffer.count() > 0)
				m_buffer[m_buffer.size()-1].append(line);
			else
				m_buffer << line;
			incomplete = false;
			kdDebug(500) << "COMPLETE LINE READ (" << m_buffer.count() << ")" << endl;
		}
		else
		{
			if (line.startsWith("smb:") || line.startsWith("rpcclient $"))
			{
				kdDebug(500) << "END OF ACTION" << endl;
				checkActionStatus();
				if (m_status)
					nextAction();
				else
				{
					// quit program
					kdDebug(500) << "EXITING PROGRAM..." << endl;
					m_proc.writeStdin("quit\n", 5);
					kdDebug(500) << "SENT" << endl;
				}
				return;
			}
			else
			{
				if (incomplete && m_buffer.count() > 0)
					m_buffer[m_buffer.size()-1].append(line);
				else
					m_buffer << line;
				incomplete = true;
				kdDebug(500) << "INCOMPLETE LINE READ (" << m_buffer.count() << ")" << endl;
			}
		}
	}
}
Ejemplo n.º 22
0
void CCScheduler::processScheduledActions()
{
    // Early out so we don't spam TRACE_EVENTS with useless processScheduledActions.
    if (nextAction() == CCSchedulerStateMachine::ACTION_NONE) {
        m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded());
        return;
    }

    // This function can re-enter itself. For example, draw may call
    // setNeedsCommit. Proceeed with caution.
    CCSchedulerStateMachine::Action action;
    do {
        action = nextAction();
        m_stateMachine.updateState(action);
        TRACE_EVENT1("cc", "CCScheduler::processScheduledActions()", "action", action);

        switch (action) {
        case CCSchedulerStateMachine::ACTION_NONE:
            break;
        case CCSchedulerStateMachine::ACTION_BEGIN_FRAME:
            m_client->scheduledActionBeginFrame();
            break;
        case CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES:
            m_client->scheduledActionUpdateMoreResources();
            if (!m_client->hasMoreResourceUpdates()) {
                // If we were just told to update resources, but there are no
                // more pending, then tell the state machine that the
                // beginUpdateMoreResources completed. If more are pending,
                // then we will ack the update at the next draw.
                m_updateMoreResourcesPending = false;
                m_stateMachine.beginUpdateMoreResourcesComplete(false);
            } else
                m_updateMoreResourcesPending = true;
            break;
        case CCSchedulerStateMachine::ACTION_COMMIT:
            m_client->scheduledActionCommit();
            break;
        case CCSchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: {
            CCScheduledActionDrawAndSwapResult result = m_client->scheduledActionDrawAndSwapIfPossible();
            m_stateMachine.didDrawIfPossibleCompleted(result.didDraw);
            if (result.didSwap)
                m_frameRateController->didBeginFrame();
            break;
        }
        case CCSchedulerStateMachine::ACTION_DRAW_FORCED: {
            CCScheduledActionDrawAndSwapResult result = m_client->scheduledActionDrawAndSwapForced();
            if (result.didSwap)
                m_frameRateController->didBeginFrame();
            break;
        } case CCSchedulerStateMachine::ACTION_BEGIN_CONTEXT_RECREATION:
            m_client->scheduledActionBeginContextRecreation();
            break;
        case CCSchedulerStateMachine::ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD:
            m_client->scheduledActionAcquireLayerTexturesForMainThread();
            break;
        }
    } while (action != CCSchedulerStateMachine::ACTION_NONE);

    // Activate or deactivate the frame rate controller.
    m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded());
}
Ejemplo n.º 23
0
void ProgressActionsTestScene::runThisTest()
{
    addChild(nextAction());
    CCDirector::sharedDirector()->replaceScene(this);
}
Ejemplo n.º 24
0
void UITestScene::runThisTest()
{
    auto layer = nextAction();
    addChild(layer);
    Director::getInstance()->replaceScene(this);
}