Esempio n. 1
0
		public static int GetPower(UserDetailsContract detailsContract, int ownedAlbumCount, int albumRatingCount) {

			ParamIs.NotNull(() => detailsContract);
			var songListCount = detailsContract.SongLists.Count();

			var power =
				detailsContract.EditCount / 4
				+ detailsContract.SubmitCount / 2
				+ detailsContract.TagVotes * 2
				+ detailsContract.AlbumCollectionCount * 2
				+ ownedAlbumCount * 5
				+ albumRatingCount * 3
				+ detailsContract.FavoriteSongCount * 2
				+ detailsContract.CommentCount * 4
				+ songListCount * 5
				+ (detailsContract.EmailVerified ? 100 : 0);

			return power;

		}
Esempio n. 2
0
        public static int GetPower(UserDetailsContract detailsContract, User user)
        {
            ParamIs.NotNull(() => detailsContract);
            ParamIs.NotNull(() => user);

            var ownedAlbumCount = user.Albums.Count(a => a.PurchaseStatus == PurchaseStatus.Owned);
            var albumRatingCount = user.Albums.Count(a => a.Rating != 0);
            var songListCount = detailsContract.SongLists.Count();

            var power =
                detailsContract.EditCount / 4
                + detailsContract.SubmitCount / 2
                + detailsContract.TagVotes * 2
                + detailsContract.AlbumCollectionCount * 2
                + ownedAlbumCount * 5
                + albumRatingCount * 3
                + detailsContract.FavoriteSongCount * 2
                + detailsContract.CommentCount * 4
                + songListCount * 5;

            return power;
        }