コード例 #1
0
ファイル: bank.cpp プロジェクト: FilipStefaniuk/JNP_ZAD6
Bank& Bank::BankApplication::createBank() {
    gkb()._bankRegister.push_back(std::make_shared<Bank>(
            Bank(_name, _checkingAccountFees,
                        _currencyAccountFees,
                        _savingAccountFees)));
    return **(gkb()._bankRegister.rbegin());
}
コード例 #2
0
ファイル: rational.cpp プロジェクト: fritzo/kazoo
Harmony::Analyzer::Analyzer (
    const std::vector<Number> & points,
    float acuity)
    : Synchronized::FourierBank2(Bank(
                                     points.size(),
                                     BOGUS_MIN_FREQ,
                                     BOGUS_MAX_FREQ,
                                     acuity))
{
    // adapted from Synchronized::Bank::init_decay_transform

    ASSERT_EQ(points.size(), size);
    const float omega0 = 2 * M_PI * MIDDLE_C_HZ / DEFAULT_SAMPLE_RATE;
    const float order = 2;
    const float damp_factor = pow(2, 1.0 / order) - 1;
    const float dpitch = log(2) / acuity;
    const float min_timescale = DEFAULT_FRAMES_PER_BUFFER;

    for (size_t i = 0, I = size; i < I; ++i) {
        double freq = omega0 * points[i].to_float();
        double dfreq = 1 / (1 / fabs(dpitch * freq) + min_timescale);
        std::complex<double> omega(-damp_factor * dfreq, freq);
        std::complex<double> trans = exp(omega);

        m_trans_real[i] = trans.real();
        m_trans_imag[i] = trans.imag();
        m_rescale[i] = pow(dfreq, order); // = 1 / E(w,0)
    }
}
コード例 #3
0
ファイル: Aircraft.cpp プロジェクト: GRMaverick/DirectX_FGGC
void Aircraft::Update(float elapsedTime)
{
    Move();
    Lift();
    Bank();
    UpdateWorld();
}
コード例 #4
0
ファイル: Dope.cpp プロジェクト: Bootz/DopeWars
/* City #1 - Rules Are Rules */
void dope::Detroit()
{
    do
    {
        system ("cls");
        Status();

        for(int i = 0; i < 32; i++)
        {
            cout << '\xb1';
        }

        cout << endl;
        cout << '\xb1' << "  Dope Prices      " << '\xb1' << "  Tools   " << '\xb1' << endl;
        cout << '\xb1' << "                   " << '\xb1' << "          " << '\xb1' << endl;
        cout << '\xb1' << " 1. Weed    = $50  " << '\xb1' << "  7. Buy  " << '\xb1' << endl;
        cout << '\xb1' << " 2. Heroin  = $10  " << '\xb1' << "  8. Sell " << '\xb1' << endl;
        cout << '\xb1' << " 3. Cocaine = $200 " << '\xb1' << "  9. Bank " << '\xb1' << endl;
        cout << '\xb1' << " 4. MJ      = $20  " << '\xb1' << " 10. Coat " << '\xb1' << endl;
        cout << '\xb1' << " 5. Ecstasy = $35  " << '\xb1' << " 11. Quit " << '\xb1' << endl;
        cout << '\xb1' << " 6. Acid    = $175 " << '\xb1' << "          " << '\xb1';
        cout << endl;

        for (int j = 0; j < 32; j++)
        {
            cout << '\xb1';
        }

        cout << endl;
        cout << "Tool Choice: ";
        cin >> decision;

        switch (decision)
        {
            case 7:
                Purchase(x, y);
                break;
            case 8:
                Sell(a, b);
                break;
            case 9:
                Bank();
                break;
            case 10:
                Coat();
                break;
            case 11:
                exit(11);
                break;
            default:
                cout << "Invalid Choice!\n";
                break;
        }
    }
    while ((decision < 7) || (decision > 11));

    return;
}
コード例 #5
0
Bank& BankBuilderImpl::createBank() {
    if (used_once_)
        throw std::runtime_error("createBank used more than once");
    used_once_ = true;
    return gkb().addBank(Bank(accountRegistry_,
                              std::move(bankName_),
                              std::move(checkingAccount_),
                              std::move(savingAccount_),
                              std::move(currencyAccount_)));
}
コード例 #6
0
ファイル: main.cpp プロジェクト: SPbSTUstud/rts
int _tmain(int argc, _TCHAR* argv[])
{
	HANDLE hMutex = CreateMutex(NULL, FALSE, L"BankMutex");
	ReleaseMutex(hMutex);

	Bank bank = Bank(2000000);
	Client c1 = Client(&bank, 2000);
	Client c2 = Client(&bank, 2000000);
		
	while(1) {};

	CloseHandle(hMutex);
	return 0;
}
コード例 #7
0
ファイル: rational.cpp プロジェクト: fritzo/kazoo
Harmony::Synthesizer::Synthesizer (const std::vector<Number> & points)
    : Synchronized::SimpleBank(Bank(
                                   points.size(),
                                   BOGUS_MIN_FREQ,
                                   BOGUS_MAX_FREQ))
{
    // adapted from Synchronized::Bank::init_transform

    ASSERT_EQ(points.size(), size);
    float omega0 = 2 * M_PI * MIDDLE_C_HZ / DEFAULT_SAMPLE_RATE;
    for (size_t i = 0; i < size; ++i) {
        float omega = omega0 * points[i].to_float();

        m_frequency[i] = tan(omega);
    }
}