Use ternary conditions to gain coverage
This commit is contained in:
parent
887a190f11
commit
0c2b10b031
|
@ -217,18 +217,15 @@ class Tile(Enum):
|
||||||
to the texture pack
|
to the texture pack
|
||||||
"""
|
"""
|
||||||
val = getattr(pack, self.name)
|
val = getattr(pack, self.name)
|
||||||
if isinstance(val, tuple):
|
return val[0] if isinstance(val, tuple) else val
|
||||||
return val[0]
|
|
||||||
return val
|
|
||||||
|
|
||||||
def color(self, pack: TexturePack) -> Tuple[int, int]:
|
def color(self, pack: TexturePack) -> Tuple[int, int]:
|
||||||
"""
|
"""
|
||||||
Retrieve the tuple (fg_color, bg_color) of the current Tile.
|
Retrieve the tuple (fg_color, bg_color) of the current Tile.
|
||||||
"""
|
"""
|
||||||
val = getattr(pack, self.name)
|
val = getattr(pack, self.name)
|
||||||
if isinstance(val, tuple):
|
return (val[1], val[2]) if isinstance(val, tuple) else \
|
||||||
return val[1], val[2]
|
(pack.tile_fg_color, pack.tile_bg_color)
|
||||||
return pack.tile_fg_color, pack.tile_bg_color
|
|
||||||
|
|
||||||
def is_wall(self) -> bool:
|
def is_wall(self) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue