예제 #1
0
 void VThreadProc(void)
 {
     std::shared_ptr<IResHandle> handle = m_pCache->VGetHandle(m_res);
     if(m_cb)
     {
         m_cb(handle);
     }
     Succeed();
 }
예제 #2
0
 void ActorProcess::DeleteActorDelegate(IEventPtr data)
 {
     std::shared_ptr<DeleteActorEvent> event = std::static_pointer_cast<DeleteActorEvent>(data);
     if(event->m_id == m_actor->GetId())
     {
         VOnActorDelete();
         Succeed();
     }
 }
예제 #3
0
void UnprotectedProcess::VThreadProc()
{
	DWORD dwCount = 0;
	while (dwCount < m_maxLoops)
	{
		dwCount++;
		g_unprotectedTotal++;
	}

	Succeed();
}
예제 #4
0
void MainMenuProcess::VOnInit( void )
{
	UIElement* pScreen = UserInterface::AddScreenFromFile( "MainMenu", "Screens/MainMenu.xml" );
	pScreen->GetElement<UIButton>( "btn_new_game" )->SetCallbackFunction( [&] ( UIElement* pElement, void* pArgs )
	{
		GameProcess* pGameProcess = new GameProcess();
		AttachChild( pGameProcess );
		pGameProcess->Release();

		Succeed();
	});
}
예제 #5
0
void ProtectedProcess::VThreadProc()
{
	DWORD dwCount = 0;

	while (dwCount < m_maxLoops)
	{
		dwCount++;

		{
			ScopedCriticalSection locker(g_criticalSection);
			g_protectedTotal++;
		}
	}

	Succeed();
}
예제 #6
0
void Place(int S)
{
    LevelCount[S]++;
    Count++;

    if (S >= 81) {
       Succeed();
       return;
    }

    int S2 = NextSeq(S);
    SwapSeqEntries(S, S2);

    int Square = Sequence[S];

    int 	BlockIndex = InBlock[Square],
			RowIndex = InRow[Square],
			ColIndex = InCol[Square];

    int 	Possibles = Block[BlockIndex] & Row[RowIndex] & Col[ColIndex];
    while (Possibles) {
          int valbit = Possibles & (-Possibles); // Lowest 1 bit in Possibles
          Possibles &= ~valbit;
          Entry[Square] = valbit;
          Block[BlockIndex] &= ~valbit;
          Row[RowIndex] &= ~valbit;
          Col[ColIndex] &= ~valbit;
				
          Place(S + 1);

          Entry[Square] = BLANK; // Could be moved out of the loop
          Block[BlockIndex] |= valbit;
          Row[RowIndex] |= valbit;
          Col[ColIndex] |= valbit;
	}

    SwapSeqEntries(S, S2);
}