예제 #1
0
void CEngine::_MainLoop()
{    
	_Running = true;
        
    _pGameInterface->Init();
    
    if (_ProcessInterval == 0) {
        SetProcessInterval(30);
    }
    
    double dTime = glfwGetTime();
    
	while (_Running)
    {
		_Draw();
        if ((glfwGetTime() - dTime) > _ProcessInterval)
        {
            _Process();
            dTime = glfwGetTime();
        }
	}
    _pGameInterface->Free();
    
	glfwTerminate();
}
예제 #2
0
// This CAN have values that are reset
void OTTrade::InitTrade()
{
    // initialization here. Sometimes also called during cleanup to zero values.
    m_strContractType = "TRADE";

    SetProcessInterval(TradeProcessIntervalSeconds); // Trades default to
                                                     // processing every 10
                                                     // seconds.
    // (vs 1 second for Cron items and 1 hour for payment plans)

    tradesAlreadyDone_ = 0;

    stopSign_ = 0;          // IS THIS a STOP order? Value is 0, or '<', or '>'.
    stopPrice_ = 0;         // The price limit that activates the STOP order.
    stopActivated_ = false; // Once the Stop Order activates, it puts the
                            // order on the market.
    // I'll put a "HasOrderOnMarket()" bool method that answers this for u.
    hasTradeActivated_ = false; // I want to keep track of general activations
                                // as well, not just stop orders.
}