Revert "Use SortedDictionary for Highscores instead of a simple Dictionary"
This reverts commit 4833ccd6
This commit is contained in:
parent
4833ccd65a
commit
aef50aa2de
4 changed files with 6 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -63,7 +63,7 @@ namespace Geekbot.net.Commands.User.Ranking
|
||||||
}
|
}
|
||||||
|
|
||||||
var guildId = Context.Guild.Id;
|
var guildId = Context.Guild.Id;
|
||||||
SortedDictionary<HighscoreUserDto, int> highscoreUsers;
|
Dictionary<HighscoreUserDto, int> highscoreUsers;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
highscoreUsers = _highscoreManager.GetHighscoresWithUserData(type, guildId, amount);
|
highscoreUsers = _highscoreManager.GetHighscoresWithUserData(type, guildId, amount);
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Geekbot.net.Lib.Highscores
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedDictionary<HighscoreUserDto, int> GetHighscoresWithUserData(HighscoreTypes type, ulong guildId, int amount)
|
public Dictionary<HighscoreUserDto, int> GetHighscoresWithUserData(HighscoreTypes type, ulong guildId, int amount)
|
||||||
{
|
{
|
||||||
Dictionary<ulong, int> list;
|
Dictionary<ulong, int> list;
|
||||||
switch (type)
|
switch (type)
|
||||||
|
@ -47,7 +47,7 @@ namespace Geekbot.net.Lib.Highscores
|
||||||
throw new HighscoreListEmptyException($"No {type} found for guild {guildId}");
|
throw new HighscoreListEmptyException($"No {type} found for guild {guildId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
var highscoreUsers = new SortedDictionary<HighscoreUserDto, int>();
|
var highscoreUsers = new Dictionary<HighscoreUserDto, int>();
|
||||||
foreach (var user in list)
|
foreach (var user in list)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace Geekbot.net.Lib.Highscores
|
||||||
{
|
{
|
||||||
public interface IHighscoreManager
|
public interface IHighscoreManager
|
||||||
{
|
{
|
||||||
SortedDictionary<HighscoreUserDto, int> GetHighscoresWithUserData(HighscoreTypes type, ulong guildId, int amount);
|
Dictionary<HighscoreUserDto, int> GetHighscoresWithUserData(HighscoreTypes type, ulong guildId, int amount);
|
||||||
Dictionary<ulong, int> GetMessageList(ulong guildId, int amount);
|
Dictionary<ulong, int> GetMessageList(ulong guildId, int amount);
|
||||||
Dictionary<ulong, int> GetKarmaList(ulong guildId, int amount);
|
Dictionary<ulong, int> GetKarmaList(ulong guildId, int amount);
|
||||||
Dictionary<ulong, int> GetRollsList(ulong guildId, int amount);
|
Dictionary<ulong, int> GetRollsList(ulong guildId, int amount);
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace Geekbot.net.WebApi.Controllers.Highscores
|
||||||
return BadRequest(error);
|
return BadRequest(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
SortedDictionary<HighscoreUserDto, int> list;
|
Dictionary<HighscoreUserDto, int> list;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
list = _highscoreManager.GetHighscoresWithUserData(body.Type, body.GuildId, body.Amount);
|
list = _highscoreManager.GetHighscoresWithUserData(body.Type, body.GuildId, body.Amount);
|
||||||
|
|
Loading…
Reference in a new issue