git repos / oastat

src/oss2db/CtfElimination2Db.cpp

browsing at commit = 9c9925de9f32417faf33691742b7f07a7198dfe8

raw · blame · history

/* 
 * File:   CtfElimination2Db.cpp
 * Author: poul
 * 
 * Created on 21. januar 2011, 21:12
 */

#include "CtfElimination2Db.hpp"

string CtfElimination2Db::getCommand() {
    return "ELIMINATION";
}

bool CtfElimination2Db::canProcess(OaStatStruct oss) {
    if(oss.command != getCommand() || oss.parameters.size()<3 )
        return false;
    return true;
}

void CtfElimination2Db::process(OaStatStruct oss) {
    if(!canProcess(oss))
        return; //Invalid oss

    string player = "";
    if(oss.parameters.at(1)!=-1)
        player= clientIdMap.at(oss.parameters.at(1));

    dp->addCtfElimination(oss.second,oss.parameters.at(0) /*roundnumber*/,
            player,oss.parameters.at(2) /*team*/, oss.parameters.at(3) /*event*/);
}