Justice Guard
This commit is contained in:
parent
12589a7452
commit
a16f5bb56e
3 changed files with 46 additions and 4 deletions
|
|
@ -61,6 +61,19 @@ class Database {
|
|||
|
||||
return 0
|
||||
}
|
||||
|
||||
foreseeRank(record) {
|
||||
const users = this.db.data.users
|
||||
.filter(user => user.record)
|
||||
.sort((a, b) => a.record > b.record ? -1 : 1)
|
||||
|
||||
for (let i = 0; i < users.length; ++i) {
|
||||
if (users[i].record < record)
|
||||
return i + 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
export default new Database
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue