コード例 #1
0
void Random<T_PRNG>::SaveLog(const std::string& filename)
{
    const std::vector<RandomEntry> log = GetAsyncLog();
    bnw::ofstream file(filename);

    for(const auto& curLog : log)
        file << curLog << std::endl;
}
コード例 #2
0
ファイル: Random.cpp プロジェクト: Flow86/s25client
void Random::SaveLog(const std::string& filename)
{
    std::vector<RandomEntry> log = GetAsyncLog();
    FILE* file = fopen(filename.c_str(), "w");

    for(std::vector<RandomEntry>::const_iterator it = log.begin(); it != log.end(); ++it)
    {
        fprintf(file, "%u:R(%d)=%d,z=%d | %s#%u|id=%u\n",
            it->counter,
            it->max, it->GetValue(), it->rngState,
            it->src_name.c_str(), it->src_line,
            it->obj_id);
    }

    fclose(file);
}