-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrank.py
More file actions
34 lines (29 loc) · 773 Bytes
/
rank.py
File metadata and controls
34 lines (29 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from __future__ import annotations
from enum import Enum
from functools import total_ordering
# Might be useless
@total_ordering
class Rank(Enum):
LOW_IRON = 0
HIGH_IRON = 100
LOW_BRONZE = 200
HIGH_BRONZE = 300
LOW_SILVER = 400
HIGH_SILVER = 500
LOW_GOLD = 600
HIGH_GOLD = 700
LOW_PLAT = 800
HIGH_PLAT = 900
LOW_EMERALD = 1000
HIGH_EMERALD = 1100
LOW_DIAMOND = 1200
HIGH_DIAMOND = 1300
MASTER = 1400
GRANDMASTER = 1500
CHALLENGER = 1600
def __eq__(self, __other: Rank) -> bool:
return self.value == __other.value
def __gt__(self, __other: Rank) -> bool:
return self.value > __other.value
def __le__(self, __other: Rank) -> bool:
return self.value <= __other.value