From 588bbdd5b4f9f35c29832425a794a9754c7b91f8 Mon Sep 17 00:00:00 2001 From: Ninjdai1 Date: Fri, 13 Oct 2023 15:08:02 +0200 Subject: [PATCH] Removed trailing whitespaces --- index.py | 8 ++++---- src/database/__init__.py | 1 - src/database/load.py | 1 - src/database/manager.py | 1 - src/database/save.py | 1 - src/inventory/__init__.py | 1 - src/inventory/inventory.py | 1 - src/inventory/item.py | 1 - src/inventory/itemtypes/__init__.py | 1 - src/inventory/itemtypes/consumable.py | 3 +-- src/inventory/itemtypes/equipment.py | 3 +-- src/inventory/itemtypes/stackable_item.py | 2 +- src/inventory/itemtypes/weapon.py | 2 +- src/player/__init__.py | 1 - src/player/player_manager.py | 1 - src/signals/__init__.py | 1 - src/signals/signal.py | 2 +- 17 files changed, 9 insertions(+), 22 deletions(-) diff --git a/index.py b/index.py index 883a60b..a8ce3cd 100644 --- a/index.py +++ b/index.py @@ -1,13 +1,13 @@ from src.inventory import Inventory, Item, Equipment, Consumable, Weapon, StackableItem from src.player import Player -#from src.database import save, load +#from src.database import save, load class Game: def __init__(self) -> None: print("######\nRPyG\n######") def start(self) -> None: print("Loading player") - self.player = Player() + self.player = Player() print("Starting game !") @@ -27,10 +27,10 @@ def start(self) -> None: coins.count -= 11111 print(sword, shield, potion, coins, "\n") - + game.player.inventory.add(sword, shield, potion, coins) print(game.player.inventory, "\n") - + sword.destroy() print(game.player.inventory, "\n") diff --git a/src/database/__init__.py b/src/database/__init__.py index 4e28e17..d4bc023 100644 --- a/src/database/__init__.py +++ b/src/database/__init__.py @@ -2,4 +2,3 @@ from .save import save_instance as save from .load import load_instance as load - diff --git a/src/database/load.py b/src/database/load.py index e5c3e94..c5f2b38 100644 --- a/src/database/load.py +++ b/src/database/load.py @@ -5,4 +5,3 @@ def load_instance(save_name): with open(f"{save_name}.pickle", "rb") as file_: data = pickle.load(file_) return data - return False diff --git a/src/database/manager.py b/src/database/manager.py index e2731c3..f72a255 100644 --- a/src/database/manager.py +++ b/src/database/manager.py @@ -2,4 +2,3 @@ class DatabaseManager: def __init__(self) -> None: pass - diff --git a/src/database/save.py b/src/database/save.py index 415c59a..14cda87 100644 --- a/src/database/save.py +++ b/src/database/save.py @@ -4,4 +4,3 @@ def save_instance(instance, save_name): """Saves the inputed instance to a file""" with open(f"{save_name}.pickle", "wb") as file_: pickle.dump(instance, file_, -1) - diff --git a/src/inventory/__init__.py b/src/inventory/__init__.py index 109c543..d93972e 100644 --- a/src/inventory/__init__.py +++ b/src/inventory/__init__.py @@ -4,4 +4,3 @@ from .item import Item from .itemtypes import Equipment, Consumable, Weapon, StackableItem - diff --git a/src/inventory/inventory.py b/src/inventory/inventory.py index e9d2ad1..7847003 100644 --- a/src/inventory/inventory.py +++ b/src/inventory/inventory.py @@ -25,4 +25,3 @@ def clear(self) -> None: """Clears the inventory""" self._items = [] - diff --git a/src/inventory/item.py b/src/inventory/item.py index 7de0d00..24aeefb 100644 --- a/src/inventory/item.py +++ b/src/inventory/item.py @@ -22,4 +22,3 @@ def destroy(self) -> None: The item instance itself is not destroyed, it's only removed from the inventories it was in """ self.destroyed.fire(self) - diff --git a/src/inventory/itemtypes/__init__.py b/src/inventory/itemtypes/__init__.py index eec2895..07cc78d 100644 --- a/src/inventory/itemtypes/__init__.py +++ b/src/inventory/itemtypes/__init__.py @@ -12,4 +12,3 @@ # Stackable items from .stackable_item import StackableItem - diff --git a/src/inventory/itemtypes/consumable.py b/src/inventory/itemtypes/consumable.py index d0847a5..d71ace0 100644 --- a/src/inventory/itemtypes/consumable.py +++ b/src/inventory/itemtypes/consumable.py @@ -2,7 +2,7 @@ class Consumable(Item): """Consumable class - + Derives from Item, comes out of the box with effects and misc attributes for consumable creation Attributes: @@ -18,4 +18,3 @@ def __init__(self, effects: list = [], duration: float = 60, uses: int = 1, **kw def __repr__(self) -> str: return f"" - diff --git a/src/inventory/itemtypes/equipment.py b/src/inventory/itemtypes/equipment.py index 06a5c39..f618121 100644 --- a/src/inventory/itemtypes/equipment.py +++ b/src/inventory/itemtypes/equipment.py @@ -2,7 +2,7 @@ class Equipment(Item): """Base equipment class - + Derives from Item, comes out of the box with durability and other functions to ease the process of creating equipment items Attributes: @@ -34,4 +34,3 @@ def repair(self, damage: int = -1) -> int: if self.durability > self.max_durability: self.durability = self.max_durability return self.durability - diff --git a/src/inventory/itemtypes/stackable_item.py b/src/inventory/itemtypes/stackable_item.py index dd35664..63d6148 100644 --- a/src/inventory/itemtypes/stackable_item.py +++ b/src/inventory/itemtypes/stackable_item.py @@ -2,7 +2,7 @@ class StackableItem(Item): """Stackable item class - + Derives from Item, comes out of the box with count and methods to manage stackable items """ def __init__(self, count: int = 1, **kwargs) -> None: diff --git a/src/inventory/itemtypes/weapon.py b/src/inventory/itemtypes/weapon.py index 498e556..c7830cf 100644 --- a/src/inventory/itemtypes/weapon.py +++ b/src/inventory/itemtypes/weapon.py @@ -2,7 +2,7 @@ class Weapon(Equipment): """Weapon class: - + Derives from Equipment, helps with creating weapons Attributes: diff --git a/src/player/__init__.py b/src/player/__init__.py index 78e7164..224480c 100644 --- a/src/player/__init__.py +++ b/src/player/__init__.py @@ -1,4 +1,3 @@ """Player management""" from .player_manager import Player - diff --git a/src/player/player_manager.py b/src/player/player_manager.py index 0088706..3ba8e3e 100644 --- a/src/player/player_manager.py +++ b/src/player/player_manager.py @@ -4,4 +4,3 @@ class Player: def __init__(self) -> None: self.inventory = Inventory() - diff --git a/src/signals/__init__.py b/src/signals/__init__.py index 1c6e952..29c1ffa 100644 --- a/src/signals/__init__.py +++ b/src/signals/__init__.py @@ -1,4 +1,3 @@ """Trigger functions between classes""" from .signal import Signal - diff --git a/src/signals/signal.py b/src/signals/signal.py index 1521648..55ebfc5 100644 --- a/src/signals/signal.py +++ b/src/signals/signal.py @@ -2,7 +2,7 @@ class Signal: """Signals Signals are meant to be used as a way to transfer events between multiple classes, such as item destroys or health gain - + """ def __init__(self): self._handlers = []