Merge branch 'master' of github.com:eeriks/erepublik
This commit is contained in:
commit
c78dbae925
@ -49,6 +49,9 @@ class Country:
|
||||
except ValueError:
|
||||
return self == other
|
||||
|
||||
@property
|
||||
def __dict__(self):
|
||||
return dict(id=self.id, name=self.name, iso=self.iso)
|
||||
|
||||
class ErepublikException(Exception):
|
||||
def __init__(self, message):
|
||||
@ -683,6 +686,10 @@ class BattleSide:
|
||||
def __format__(self, format_spec):
|
||||
return self.country.iso
|
||||
|
||||
@property
|
||||
def __dict__(self):
|
||||
return dict(points=self.points, country=self.country, defender=self.defender, allies=self.allies, deployed=self.deployed)
|
||||
|
||||
|
||||
class BattleDivision:
|
||||
id: int
|
||||
@ -696,6 +703,11 @@ class BattleDivision:
|
||||
div: int
|
||||
battle: "Battle"
|
||||
|
||||
@property
|
||||
def __dict__(self):
|
||||
return dict(id=self.id, division=self.div, terrain=(self.terrain, self.terrain_display), wall=self.wall,
|
||||
dom_pts=self.dom_pts, epic=self.epic, battle=str(self.battle), end=self.div_end)
|
||||
|
||||
@property
|
||||
def is_air(self):
|
||||
return self.div == 11
|
||||
@ -753,6 +765,12 @@ class Battle:
|
||||
region_id: int
|
||||
region_name: str
|
||||
|
||||
@property
|
||||
def __dict__(self):
|
||||
return dict(id=self.id, war_id=self.war_id, divisions=self.div, zone=self.zone_id, rw=self.is_rw,
|
||||
dict_lib=self.is_dict_lib, start=self.start, sides={'inv':self.invader,'def':self.defender},
|
||||
region=[self.region_id, self.region_name])
|
||||
|
||||
@property
|
||||
def has_air(self) -> bool:
|
||||
for div in self.div.values():
|
||||
|
Loading…
x
Reference in New Issue
Block a user