Skip to content

Commit

Permalink
Removed trailing whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjdai1 committed Oct 13, 2023
1 parent fdf68b3 commit 588bbdd
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 22 deletions.
8 changes: 4 additions & 4 deletions index.py
Original file line number Diff line number Diff line change
@@ -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 !")

Expand All @@ -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")

Expand Down
1 change: 0 additions & 1 deletion src/database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

from .save import save_instance as save
from .load import load_instance as load

1 change: 0 additions & 1 deletion src/database/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion src/database/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
class DatabaseManager:
def __init__(self) -> None:
pass

1 change: 0 additions & 1 deletion src/database/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

1 change: 0 additions & 1 deletion src/inventory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
from .item import Item
from .itemtypes import Equipment, Consumable, Weapon, StackableItem


1 change: 0 additions & 1 deletion src/inventory/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ def clear(self) -> None:
"""Clears the inventory"""
self._items = []


1 change: 0 additions & 1 deletion src/inventory/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

1 change: 0 additions & 1 deletion src/inventory/itemtypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@

# Stackable items
from .stackable_item import StackableItem

3 changes: 1 addition & 2 deletions src/inventory/itemtypes/consumable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -18,4 +18,3 @@ def __init__(self, effects: list = [], duration: float = 60, uses: int = 1, **kw

def __repr__(self) -> str:
return f"<Consumable({self.name} - {self.effects} for {self.duration}s)>"

3 changes: 1 addition & 2 deletions src/inventory/itemtypes/equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

2 changes: 1 addition & 1 deletion src/inventory/itemtypes/stackable_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/inventory/itemtypes/weapon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Weapon(Equipment):
"""Weapon class:
Derives from Equipment, helps with creating weapons
Attributes:
Expand Down
1 change: 0 additions & 1 deletion src/player/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""Player management"""

from .player_manager import Player

1 change: 0 additions & 1 deletion src/player/player_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
class Player:
def __init__(self) -> None:
self.inventory = Inventory()

1 change: 0 additions & 1 deletion src/signals/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""Trigger functions between classes"""

from .signal import Signal

2 changes: 1 addition & 1 deletion src/signals/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 588bbdd

Please sign in to comment.