Score() public method

Returns a cumulative score based on contribution to Mono.
public Score ( ) : int
return int
Example #1
0
File: HtmlOut.cs Project: mono/rank
 private static string ReplaceKeywords(string html, Users user, int rank)
 {
     Gravatar img = new Gravatar(user.email[0], Gravatar.IconSets.identicon, Gravatar.Ratings.g, 50);
     string gravatar = img.GravatarURL();
     return html.Replace("<!-- rank -->", rank.ToString())
         .Replace("<!-- name -->", user.Name)
         .Replace("<!-- code -->", user.CodeAdded().ToString())
         .Replace("<!-- email -->", user.email[0])
         .Replace("<!-- Gravatar -->", gravatar)
         .Replace("<!-- Image -->", ReplaceImageName(user))
         .Replace("<!-- score -->", user.Score().ToString())
         .Replace("<!-- commits -->", user.CommitCount().ToString());
 }
Example #2
0
File: HtmlOut.cs Project: mono/rank
        private static string ReplaceImageName(Users user)
        {
            int GROVE = 50000;
            int TREE = 5000;
            int CRATE = 500;
            int BUNCHES = 50;
            int BUNCH = 0;
            int PEEL = 0;

            if (user.Score() > GROVE)
            {
                return "grove.png";
            }
            else if (user.Score() > TREE)
            {
                return "banana_tree.png";
            }
            else if (user.Score() > CRATE)
            {
                return "crate.png";
            }
            else if (user.Score() > BUNCHES)
            {
                return "banana_bunches.png";
            }
            else if (user.Score() > BUNCH)
            {
                return "3_bananas.png";
            }
            else if (user.Score() == PEEL)
            {
                return "peel.png";
            }

            return "";
        }