All pastes #24594 Raw Edit

Stuff

public text v1 · immutable
#24594 ·published 2005-10-04 15:49 UTC
rendered paste body
public final StatsSet getHighestScoreData(int cabal, int festivalId)
    {
        if (cabal == SevenSigns.CABAL_DAWN)
            festivalId += 5;
        
        // Attempt to retrieve existing score data (if found), otherwise create a 
        // new blank data set and add it to the overall festival data set.
        StatsSet festivalDat;
        
        try {
            festivalDat = _festivalData.get(_signsCycle).get(festivalId);
        }
        catch (NullPointerException e)
        {
            festivalDat = new StatsSet(); 
            festivalDat.set("festivalId", festivalId);
            festivalDat.set("cabal", cabal);
            festivalDat.set("cycle", _signsCycle);
            festivalDat.set("date", "0");
            festivalDat.set("score", 0);
            festivalDat.set("members", "");
            
            // Retreive the existing data, and append to it.
            HashMap<Integer, StatsSet> festivalData = _festivalData.get(_signsCycle);
            
            if (festivalData == null)
                festivalData = new HashMap<Integer, StatsSet>(); 
            
            festivalData.put(festivalId, festivalDat);
            _festivalData.put(_signsCycle, festivalData);
        }
        
        return festivalDat;
    }