diff --git a/squirrelbattle/interfaces.py b/squirrelbattle/interfaces.py index 472ee95..8fde7a9 100644 --- a/squirrelbattle/interfaces.py +++ b/squirrelbattle/interfaces.py @@ -217,18 +217,15 @@ class Tile(Enum): to the texture pack """ val = getattr(pack, self.name) - if isinstance(val, tuple): - return val[0] - return val + return val[0] if isinstance(val, tuple) else val def color(self, pack: TexturePack) -> Tuple[int, int]: """ Retrieve the tuple (fg_color, bg_color) of the current Tile. """ val = getattr(pack, self.name) - if isinstance(val, tuple): - return val[1], val[2] - return pack.tile_fg_color, pack.tile_bg_color + return (val[1], val[2]) if isinstance(val, tuple) else \ + (pack.tile_fg_color, pack.tile_bg_color) def is_wall(self) -> bool: """