From ef09979dba3d9e6fd12c7cff414974aeb472fa7a Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Fri, 29 Dec 2023 19:46:26 +0200 Subject: [PATCH] refactor(game): remove dunder methods --- src/py2048/block.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/py2048/block.py b/src/py2048/block.py index f77eef2..8d004c3 100644 --- a/src/py2048/block.py +++ b/src/py2048/block.py @@ -95,18 +95,6 @@ class Block(pygame.sprite.Sprite): } self.image.fill(color_map.get(self.value, COLORS.ERROR)) - def __add__(self, other: "Block") -> None: - """Add the value of two blocks and update the current block""" - logger.debug(f"Merging blocks ({id(self)}) and ({id(other)}) => ({id(self)}), {self.pos()}") - self.value += other.value - self.update() - - def __iadd__(self, other: "Block") -> None: - """Add the value of two blocks and updae the current block""" - logger.debug(f"Merging blocks ({id(self)}) and ({id(other)}) => ({id(self)}), {self.pos()}") - self.value += other.value - self.update() - def __repr__(self) -> str: """Return a string representation of the block""" return f"Block({id(self)}): ({self.pos()})"