Ejemplo n.º 1
0
    public bool GetIsNew(string badgeID)
    {
        bool retVal = false;

        if (BadgeStatus.ContainsKey(badgeID))
        {
            retVal = BadgeStatus[badgeID].IsNew;
        }
        return(retVal);
    }
Ejemplo n.º 2
0
    }                                                                       //Key: Badge type, Value: data to check with badges' unlock condition
    //series Badge are accumulative. For example, the level badges are awarded
    //at level 1, 5, 10, 15, 20. Even though all the level badges have their own
    //badge id they are considered as the same type

    //Change badge status. locked or unlocked
    public void UpdateBadgeStatus(string badgeID, bool isUnlocked, bool isNew)
    {
        if (BadgeStatus.ContainsKey(badgeID))
        {
            Status status = BadgeStatus[badgeID];
            status.IsUnlocked    = isUnlocked;
            status.IsNew         = isNew;
            BadgeStatus[badgeID] = status;
        }
        else
        {
            Status status = new Status(isUnlocked, isNew);
            BadgeStatus.Add(badgeID, status);
        }
    }