예제 #1
0
int CLuaRules::CreateTeamRulesParams(lua_State* L)
{
	CTeam* team = ParseTeam(L, __FUNCTION__, 1);
	if (team == NULL) {
		return 0;
	}
	CreateRulesParams(L, __FUNCTION__, 1, team->modParams, team->modParamsMap);
	return 0;
}
예제 #2
0
Bracket Parse(const std::string& str)
{
    Bracket bracket;
    std::stringstream ss(str);
    
    int count = 0;
    while(ss.good())
    {
        std::string substr;
        std::getline(ss, substr, ',');
        
        switch (count)
        {
            case (0):
            {
                bracket.name = substr;
                break;
            }
            case (1):
            {
                int score;
                sscanf(substr.c_str(), "%d", &score);
                bracket.originalScore = score;
                bracket.finalScore = score;
                break;
            }
            case (2):
            {
                bracket.west1 = ParseTeam(substr);
                break;
            }
            case (3):
            {
                bracket.west2 = ParseTeam(substr);
                break;
            }
            case (4):
            {
                bracket.westChamp = ParseTeam(substr);
                break;
            }
            case (5):
            {
                bracket.east1 = ParseTeam(substr);
                break;
            }
            case (6):
            {
                bracket.east2 = ParseTeam(substr);
                break;
            }
            case (7):
            {
                bracket.eastChamp = ParseTeam(substr);
                break;
            }
            case (8):
            {
                bracket.midwest1 = ParseTeam(substr);
                break;
            }
            case (9):
            {
                bracket.midwest2 = ParseTeam(substr);
                break;
            }
            case (10):
            {
                bracket.midwestChamp = ParseTeam(substr);
                break;
            }
            case (11):
            {
                bracket.southWestFinalFour = ParseTeam(substr);
                break;
            }
            case (12):
            {
                bracket.eastMidwestFinalFour = ParseTeam(substr);
            }
            case (13):
            {
                bracket.champion = ParseTeam(substr);
            }
        }
        
        count++;
        
    }

    return bracket;
}