Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
8cf86fb9d3 | |||
cf927df6e6 | |||
a6f5dbd05f | |||
967afa472f | |||
a65568cd0c | |||
6e45334d99 |
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
__author__ = """Eriks Karls"""
|
__author__ = """Eriks Karls"""
|
||||||
__email__ = 'eriks@72.lv'
|
__email__ = 'eriks@72.lv'
|
||||||
__version__ = '0.24.2.1'
|
__version__ = '0.24.2.4'
|
||||||
|
|
||||||
from erepublik.citizen import Citizen
|
from erepublik.citizen import Citizen
|
||||||
|
|
||||||
|
@ -93,6 +93,55 @@ class Rank:
|
|||||||
self.rank_points = rank_points
|
self.rank_points = rank_points
|
||||||
self.is_air = bool(is_air)
|
self.is_air = bool(is_air)
|
||||||
|
|
||||||
|
def __int__(self):
|
||||||
|
return self.id
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
if isinstance(other, Rank):
|
||||||
|
return self.id == other.id if other.is_air == self.is_air else False
|
||||||
|
else:
|
||||||
|
return self.id == int(other)
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
if isinstance(other, Rank):
|
||||||
|
return not self.id == other.id if other.is_air == self.is_air else True
|
||||||
|
else:
|
||||||
|
return not self.id == int(other)
|
||||||
|
|
||||||
|
def __lt__(self, other):
|
||||||
|
if isinstance(other, Rank):
|
||||||
|
return self.id < other.id if other.is_air == self.is_air else False
|
||||||
|
else:
|
||||||
|
return self.id < int(other)
|
||||||
|
|
||||||
|
def __le__(self, other):
|
||||||
|
if isinstance(other, Rank):
|
||||||
|
return self.id <= other.id if other.is_air == self.is_air else False
|
||||||
|
else:
|
||||||
|
return self.id <= int(other)
|
||||||
|
|
||||||
|
def __gt__(self, other):
|
||||||
|
if isinstance(other, Rank):
|
||||||
|
return self.id > other.id if other.is_air == self.is_air else False
|
||||||
|
else:
|
||||||
|
return self.id > int(other)
|
||||||
|
|
||||||
|
def __ge__(self, other):
|
||||||
|
if isinstance(other, Rank):
|
||||||
|
return self.id >= other.id if other.is_air == self.is_air else False
|
||||||
|
else:
|
||||||
|
return self.id >= int(other)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def as_dict(self):
|
||||||
|
return dict(id=self.id, name=self.name, rank_points=self.rank_points, is_air=self.is_air)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"{'Air' if self.is_air else 'Ground'}Rank<#{self.id} {self.name}>"
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return str(self)
|
||||||
|
|
||||||
|
|
||||||
AIR_RANK_NAMES: Dict[int, str] = {
|
AIR_RANK_NAMES: Dict[int, str] = {
|
||||||
1: 'Airman', 2: 'Airman 1st Class', 3: 'Airman 1st Class*', 4: 'Airman 1st Class**', 5: 'Airman 1st Class***', 6: 'Airman 1st Class****', 7: 'Airman 1st Class*****',
|
1: 'Airman', 2: 'Airman 1st Class', 3: 'Airman 1st Class*', 4: 'Airman 1st Class**', 5: 'Airman 1st Class***', 6: 'Airman 1st Class****', 7: 'Airman 1st Class*****',
|
||||||
@ -195,7 +244,7 @@ GROUND_RANK_POINTS: Dict[int, int] = {
|
|||||||
86: 180000000000, 87: 190000000000, 88: 200000000000, 89: 210000000000
|
86: 180000000000, 87: 190000000000, 88: 200000000000, 89: 210000000000
|
||||||
}
|
}
|
||||||
|
|
||||||
GROUND_RANKS: Dict[int, Rank] = {i: Rank(i, GROUND_RANK_NAMES[i], GROUND_RANK_POINTS[i], True) for i in range(1, 90)}
|
GROUND_RANKS: Dict[int, Rank] = {i: Rank(i, GROUND_RANK_NAMES[i], GROUND_RANK_POINTS[i], False) for i in range(1, 90)}
|
||||||
|
|
||||||
INDUSTRIES = Industries()
|
INDUSTRIES = Industries()
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.24.2.1
|
current_version = 0.24.2.4
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
||||||
|
2
setup.py
2
setup.py
@ -51,6 +51,6 @@ setup(
|
|||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
tests_require=test_requirements,
|
tests_require=test_requirements,
|
||||||
url='https://github.com/eeriks/erepublik/',
|
url='https://github.com/eeriks/erepublik/',
|
||||||
version='0.24.2.1',
|
version='0.24.2.4',
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user