Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Application::Videolympics::ServerConnector::ParseStat ( std::string  input,
int  aantal 
) [inline]

Definition at line 244 of file ServerConnector.h.

References Impala::Application::Videolympics::GlobalStats::contestActive, Impala::Util::StringParser::GetDouble(), Impala::Util::StringParser::GetInt(), GetStats(), Impala::Util::StringParser::GetString(), ILOG_DEBUG, mGlobalStats, mStats, Impala::Application::Videolympics::StatsPacket::negative, Impala::Application::Videolympics::GlobalStats::negative, Impala::Application::Videolympics::StatsPacket::positive, Impala::Application::Videolympics::GlobalStats::positive, Impala::Application::Videolympics::GlobalStats::timeSinceStart, Impala::Application::Videolympics::GlobalStats::totalRelevantShots, Impala::Application::Videolympics::StatsPacket::unjudged, and Impala::Application::Videolympics::GlobalStats::unjudged.

Referenced by Update().

00245     {
00246         Util::StringParser p = Util::StringParser(input);
00247         while (aantal--)
00248         {
00249             std::string oneline = p.GetString('\n', false);
00250             if (oneline.size() == 0)
00251                 break;
00252             Util::StringParser line = Util::StringParser(oneline);
00253             int teamnr = line.GetInt(',');
00254             if (teamnr == -1)
00255             { // global stats packet:
00256                 mGlobalStats->unjudged = line.GetInt(',');
00257                 mGlobalStats->positive = line.GetInt(',');
00258                 mGlobalStats->negative = line.GetInt(',');
00259                 mGlobalStats->timeSinceStart = line.GetDouble(',');
00260                 mGlobalStats->contestActive = line.GetInt(',');
00261                 mGlobalStats->totalRelevantShots = line.GetInt(',');
00262 
00263                 ILOG_DEBUG("Global: " << mGlobalStats->unjudged << " unjudged, " << mGlobalStats->positive << " positive, " << mGlobalStats->negative << ". contest runs for " << mGlobalStats->timeSinceStart);
00264 
00265                 if (!mGlobalStats->contestActive) {
00266                     mStats.clear();
00267                 }
00268             }
00269             else // it's a team:
00270             {
00271                 StatsPacket *t = GetStats(teamnr);
00272                 if (!t)
00273                 {
00274                     t = new StatsPacket();
00275                     mStats[teamnr] = t;
00276                 }
00277                 t->unjudged = line.GetInt(',');
00278                 t->positive = line.GetInt(',');
00279                 t->negative = line.GetInt(',');
00280                 ILOG_DEBUG(" TEAM: " << teamnr << " - pos=" << t->positive << " - neg=" << t->negative);
00281             }
00282         }
00283     }

Here is the call graph for this function:


Generated on Fri Mar 19 10:55:17 2010 for ImpalaSrc by  doxygen 1.5.1