From d0ee9ec5623a1a109d31cf690300ad130c6f18cc Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 19 Nov 2020 02:18:08 +0100 Subject: [PATCH] Rename dungeonbattle to squirrelbattle --- README.md | 4 ++-- main.py | 2 +- {dungeonbattle => squirrelbattle}/__init__.py | 0 {resources => squirrelbattle/assets}/ascii_art.txt | 0 .../assets}/example_map.txt | 0 .../assets}/example_map_2.txt | 0 {dungeonbattle => squirrelbattle}/bootstrap.py | 6 +++--- .../display/__init__.py | 0 .../display/display.py | 4 ++-- .../display/display_manager.py | 12 ++++++------ .../display/mapdisplay.py | 2 +- .../display/menudisplay.py | 4 ++-- .../display/statsdisplay.py | 2 +- .../display/texturepack.py | 0 .../entities/__init__.py | 0 .../entities/items.py | 0 .../entities/monsters.py | 0 .../entities/player.py | 0 {dungeonbattle => squirrelbattle}/enums.py | 2 +- {dungeonbattle => squirrelbattle}/game.py | 2 +- {dungeonbattle => squirrelbattle}/interfaces.py | 14 +++++++------- {dungeonbattle => squirrelbattle}/menus.py | 0 {dungeonbattle => squirrelbattle}/settings.py | 0 {dungeonbattle => squirrelbattle}/term_manager.py | 0 .../tests/__init__.py | 0 .../tests/entities_test.py | 10 +++++----- .../tests/game_test.py | 14 +++++++------- .../tests/interfaces_test.py | 6 +++--- {dungeonbattle => squirrelbattle}/tests/screen.py | 0 .../tests/settings_test.py | 2 +- 30 files changed, 43 insertions(+), 43 deletions(-) rename {dungeonbattle => squirrelbattle}/__init__.py (100%) rename {resources => squirrelbattle/assets}/ascii_art.txt (100%) rename {resources => squirrelbattle/assets}/example_map.txt (100%) rename {resources => squirrelbattle/assets}/example_map_2.txt (100%) rename {dungeonbattle => squirrelbattle}/bootstrap.py (77%) rename {dungeonbattle => squirrelbattle}/display/__init__.py (100%) rename {dungeonbattle => squirrelbattle}/display/display.py (93%) rename {dungeonbattle => squirrelbattle}/display/display_manager.py (88%) rename {dungeonbattle => squirrelbattle}/display/mapdisplay.py (97%) rename {dungeonbattle => squirrelbattle}/display/menudisplay.py (96%) rename {dungeonbattle => squirrelbattle}/display/statsdisplay.py (97%) rename {dungeonbattle => squirrelbattle}/display/texturepack.py (100%) rename {dungeonbattle => squirrelbattle}/entities/__init__.py (100%) rename {dungeonbattle => squirrelbattle}/entities/items.py (100%) rename {dungeonbattle => squirrelbattle}/entities/monsters.py (100%) rename {dungeonbattle => squirrelbattle}/entities/player.py (100%) rename {dungeonbattle => squirrelbattle}/enums.py (97%) rename {dungeonbattle => squirrelbattle}/game.py (98%) rename {dungeonbattle => squirrelbattle}/interfaces.py (96%) rename {dungeonbattle => squirrelbattle}/menus.py (100%) rename {dungeonbattle => squirrelbattle}/settings.py (100%) rename {dungeonbattle => squirrelbattle}/term_manager.py (100%) rename {dungeonbattle => squirrelbattle}/tests/__init__.py (100%) rename {dungeonbattle => squirrelbattle}/tests/entities_test.py (94%) rename {dungeonbattle => squirrelbattle}/tests/game_test.py (96%) rename {dungeonbattle => squirrelbattle}/tests/interfaces_test.py (85%) rename {dungeonbattle => squirrelbattle}/tests/screen.py (100%) rename {dungeonbattle => squirrelbattle}/tests/settings_test.py (96%) diff --git a/README.md b/README.md index 63d7374..6c1d9b3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ [![pipeline status](https://gitlab.crans.org/ynerant/dungeon-battle/badges/master/pipeline.svg)](https://gitlab.crans.org/ynerant/dungeon-battle/-/commits/master) [![coverage report](https://gitlab.crans.org/ynerant/dungeon-battle/badges/master/coverage.svg)](https://gitlab.crans.org/ynerant/dungeon-battle/-/commits/master) -# Dungeon Battle +# Squirrel Battle -Projet de génie logiciel de M1 +Attention aux couteaux des écureuils ! ## Création d'un environnement de développement diff --git a/main.py b/main.py index e918f0d..64972f1 100755 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from dungeonbattle.bootstrap import Bootstrap +from squirrelbattle.bootstrap import Bootstrap if __name__ == "__main__": Bootstrap.run_game() diff --git a/dungeonbattle/__init__.py b/squirrelbattle/__init__.py similarity index 100% rename from dungeonbattle/__init__.py rename to squirrelbattle/__init__.py diff --git a/resources/ascii_art.txt b/squirrelbattle/assets/ascii_art.txt similarity index 100% rename from resources/ascii_art.txt rename to squirrelbattle/assets/ascii_art.txt diff --git a/resources/example_map.txt b/squirrelbattle/assets/example_map.txt similarity index 100% rename from resources/example_map.txt rename to squirrelbattle/assets/example_map.txt diff --git a/resources/example_map_2.txt b/squirrelbattle/assets/example_map_2.txt similarity index 100% rename from resources/example_map_2.txt rename to squirrelbattle/assets/example_map_2.txt diff --git a/dungeonbattle/bootstrap.py b/squirrelbattle/bootstrap.py similarity index 77% rename from dungeonbattle/bootstrap.py rename to squirrelbattle/bootstrap.py index 9828fae..45c2ad1 100644 --- a/dungeonbattle/bootstrap.py +++ b/squirrelbattle/bootstrap.py @@ -1,6 +1,6 @@ -from dungeonbattle.game import Game -from dungeonbattle.display.display_manager import DisplayManager -from dungeonbattle.term_manager import TermManager +from squirrelbattle.game import Game +from squirrelbattle.display.display_manager import DisplayManager +from squirrelbattle.term_manager import TermManager class Bootstrap: diff --git a/dungeonbattle/display/__init__.py b/squirrelbattle/display/__init__.py similarity index 100% rename from dungeonbattle/display/__init__.py rename to squirrelbattle/display/__init__.py diff --git a/dungeonbattle/display/display.py b/squirrelbattle/display/display.py similarity index 93% rename from dungeonbattle/display/display.py rename to squirrelbattle/display/display.py index 6aba26a..47e4bce 100644 --- a/dungeonbattle/display/display.py +++ b/squirrelbattle/display/display.py @@ -1,8 +1,8 @@ import curses from typing import Any, Optional, Union -from dungeonbattle.display.texturepack import TexturePack -from dungeonbattle.tests.screen import FakePad +from squirrelbattle.display.texturepack import TexturePack +from squirrelbattle.tests.screen import FakePad class Display: diff --git a/dungeonbattle/display/display_manager.py b/squirrelbattle/display/display_manager.py similarity index 88% rename from dungeonbattle/display/display_manager.py rename to squirrelbattle/display/display_manager.py index 4b2604f..9ec0f88 100644 --- a/dungeonbattle/display/display_manager.py +++ b/squirrelbattle/display/display_manager.py @@ -1,12 +1,12 @@ import curses -from dungeonbattle.display.mapdisplay import MapDisplay -from dungeonbattle.display.statsdisplay import StatsDisplay -from dungeonbattle.display.menudisplay import SettingsMenuDisplay, \ +from squirrelbattle.display.mapdisplay import MapDisplay +from squirrelbattle.display.statsdisplay import StatsDisplay +from squirrelbattle.display.menudisplay import SettingsMenuDisplay, \ MainMenuDisplay -from dungeonbattle.display.texturepack import TexturePack +from squirrelbattle.display.texturepack import TexturePack from typing import Any -from dungeonbattle.game import Game, GameMode -from dungeonbattle.enums import DisplayActions +from squirrelbattle.game import Game, GameMode +from squirrelbattle.enums import DisplayActions class DisplayManager: diff --git a/dungeonbattle/display/mapdisplay.py b/squirrelbattle/display/mapdisplay.py similarity index 97% rename from dungeonbattle/display/mapdisplay.py rename to squirrelbattle/display/mapdisplay.py index 36cd616..e6cc278 100644 --- a/dungeonbattle/display/mapdisplay.py +++ b/squirrelbattle/display/mapdisplay.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from dungeonbattle.interfaces import Map +from squirrelbattle.interfaces import Map from .display import Display diff --git a/dungeonbattle/display/menudisplay.py b/squirrelbattle/display/menudisplay.py similarity index 96% rename from dungeonbattle/display/menudisplay.py rename to squirrelbattle/display/menudisplay.py index 36694d0..9108ac8 100644 --- a/dungeonbattle/display/menudisplay.py +++ b/squirrelbattle/display/menudisplay.py @@ -1,6 +1,6 @@ from typing import List -from dungeonbattle.menus import Menu, MainMenu +from squirrelbattle.menus import Menu, MainMenu from .display import Display @@ -73,7 +73,7 @@ class MainMenuDisplay(Display): super().__init__(*args) self.menu = menu - with open("resources/ascii_art.txt", "r") as file: + with open("squirrelbattle/assets/ascii_art.txt", "r") as file: self.title = file.read().split("\n") self.pad = self.newpad(max(self.rows, len(self.title) + 30), diff --git a/dungeonbattle/display/statsdisplay.py b/squirrelbattle/display/statsdisplay.py similarity index 97% rename from dungeonbattle/display/statsdisplay.py rename to squirrelbattle/display/statsdisplay.py index 70c6f0c..77ddb30 100644 --- a/dungeonbattle/display/statsdisplay.py +++ b/squirrelbattle/display/statsdisplay.py @@ -2,7 +2,7 @@ import curses from .display import Display -from dungeonbattle.entities.player import Player +from squirrelbattle.entities.player import Player class StatsDisplay(Display): diff --git a/dungeonbattle/display/texturepack.py b/squirrelbattle/display/texturepack.py similarity index 100% rename from dungeonbattle/display/texturepack.py rename to squirrelbattle/display/texturepack.py diff --git a/dungeonbattle/entities/__init__.py b/squirrelbattle/entities/__init__.py similarity index 100% rename from dungeonbattle/entities/__init__.py rename to squirrelbattle/entities/__init__.py diff --git a/dungeonbattle/entities/items.py b/squirrelbattle/entities/items.py similarity index 100% rename from dungeonbattle/entities/items.py rename to squirrelbattle/entities/items.py diff --git a/dungeonbattle/entities/monsters.py b/squirrelbattle/entities/monsters.py similarity index 100% rename from dungeonbattle/entities/monsters.py rename to squirrelbattle/entities/monsters.py diff --git a/dungeonbattle/entities/player.py b/squirrelbattle/entities/player.py similarity index 100% rename from dungeonbattle/entities/player.py rename to squirrelbattle/entities/player.py diff --git a/dungeonbattle/enums.py b/squirrelbattle/enums.py similarity index 97% rename from dungeonbattle/enums.py rename to squirrelbattle/enums.py index e5f73d9..350c196 100644 --- a/dungeonbattle/enums.py +++ b/squirrelbattle/enums.py @@ -1,7 +1,7 @@ from enum import Enum, auto from typing import Optional -from dungeonbattle.settings import Settings +from squirrelbattle.settings import Settings # This file contains a few useful enumeration classes used elsewhere in the code diff --git a/dungeonbattle/game.py b/squirrelbattle/game.py similarity index 98% rename from dungeonbattle/game.py rename to squirrelbattle/game.py index dcd6a59..05da3e8 100644 --- a/dungeonbattle/game.py +++ b/squirrelbattle/game.py @@ -38,7 +38,7 @@ class Game: Create a new game on the screen. """ # TODO generate a new map procedurally - self.map = Map.load("resources/example_map_2.txt") + self.map = Map.load("squirrelbattle/assets/example_map_2.txt") self.player = Player() self.map.add_entity(self.player) self.player.move(self.map.start_y, self.map.start_x) diff --git a/dungeonbattle/interfaces.py b/squirrelbattle/interfaces.py similarity index 96% rename from dungeonbattle/interfaces.py rename to squirrelbattle/interfaces.py index 873678a..10001fb 100644 --- a/dungeonbattle/interfaces.py +++ b/squirrelbattle/interfaces.py @@ -4,7 +4,7 @@ from math import sqrt from random import choice, randint from typing import List, Optional -from dungeonbattle.display.texturepack import TexturePack +from squirrelbattle.display.texturepack import TexturePack class Map: @@ -287,7 +287,7 @@ class Entity: """ Is this entity an item? """ - from dungeonbattle.entities.items import Item + from squirrelbattle.entities.items import Item return isinstance(self, Item) @staticmethod @@ -295,8 +295,8 @@ class Entity: """ Returns all entities subclasses """ - from dungeonbattle.entities.items import Heart, Bomb - from dungeonbattle.entities.monsters import Beaver, Hedgehog, \ + from squirrelbattle.entities.items import Heart, Bomb + from squirrelbattle.entities.monsters import Beaver, Hedgehog, \ Rabbit, TeddyBear return [Beaver, Bomb, Heart, Hedgehog, Rabbit, TeddyBear] @@ -305,10 +305,10 @@ class Entity: """ Returns all entities subclasses in a dictionary """ - from dungeonbattle.entities.player import Player - from dungeonbattle.entities.monsters import Beaver, Hedgehog, Rabbit, \ + from squirrelbattle.entities.player import Player + from squirrelbattle.entities.monsters import Beaver, Hedgehog, Rabbit, \ TeddyBear - from dungeonbattle.entities.items import Bomb, Heart + from squirrelbattle.entities.items import Bomb, Heart return { "Beaver": Beaver, "Bomb": Bomb, diff --git a/dungeonbattle/menus.py b/squirrelbattle/menus.py similarity index 100% rename from dungeonbattle/menus.py rename to squirrelbattle/menus.py diff --git a/dungeonbattle/settings.py b/squirrelbattle/settings.py similarity index 100% rename from dungeonbattle/settings.py rename to squirrelbattle/settings.py diff --git a/dungeonbattle/term_manager.py b/squirrelbattle/term_manager.py similarity index 100% rename from dungeonbattle/term_manager.py rename to squirrelbattle/term_manager.py diff --git a/dungeonbattle/tests/__init__.py b/squirrelbattle/tests/__init__.py similarity index 100% rename from dungeonbattle/tests/__init__.py rename to squirrelbattle/tests/__init__.py diff --git a/dungeonbattle/tests/entities_test.py b/squirrelbattle/tests/entities_test.py similarity index 94% rename from dungeonbattle/tests/entities_test.py rename to squirrelbattle/tests/entities_test.py index b272541..6cf2fe4 100644 --- a/dungeonbattle/tests/entities_test.py +++ b/squirrelbattle/tests/entities_test.py @@ -1,9 +1,9 @@ import unittest -from dungeonbattle.entities.items import Bomb, Heart, Item -from dungeonbattle.entities.monsters import Beaver, Hedgehog, Rabbit, TeddyBear -from dungeonbattle.entities.player import Player -from dungeonbattle.interfaces import Entity, Map +from squirrelbattle.entities.items import Bomb, Heart, Item +from squirrelbattle.entities.monsters import Beaver, Hedgehog, Rabbit, TeddyBear +from squirrelbattle.entities.player import Player +from squirrelbattle.interfaces import Entity, Map class TestEntities(unittest.TestCase): @@ -11,7 +11,7 @@ class TestEntities(unittest.TestCase): """ Load example map that can be used in tests. """ - self.map = Map.load("resources/example_map.txt") + self.map = Map.load("squirrelbattle/assets/example_map.txt") self.player = Player() self.map.add_entity(self.player) self.player.move(self.map.start_y, self.map.start_x) diff --git a/dungeonbattle/tests/game_test.py b/squirrelbattle/tests/game_test.py similarity index 96% rename from dungeonbattle/tests/game_test.py rename to squirrelbattle/tests/game_test.py index 8e7970d..424d86a 100644 --- a/dungeonbattle/tests/game_test.py +++ b/squirrelbattle/tests/game_test.py @@ -1,13 +1,13 @@ import os import unittest -from dungeonbattle.bootstrap import Bootstrap -from dungeonbattle.display.display import Display -from dungeonbattle.display.display_manager import DisplayManager -from dungeonbattle.entities.player import Player -from dungeonbattle.game import Game, KeyValues, GameMode -from dungeonbattle.menus import MainMenuValues -from dungeonbattle.settings import Settings +from squirrelbattle.bootstrap import Bootstrap +from squirrelbattle.display.display import Display +from squirrelbattle.display.display_manager import DisplayManager +from squirrelbattle.entities.player import Player +from squirrelbattle.game import Game, KeyValues, GameMode +from squirrelbattle.menus import MainMenuValues +from squirrelbattle.settings import Settings class TestGame(unittest.TestCase): diff --git a/dungeonbattle/tests/interfaces_test.py b/squirrelbattle/tests/interfaces_test.py similarity index 85% rename from dungeonbattle/tests/interfaces_test.py rename to squirrelbattle/tests/interfaces_test.py index b487eac..a55a7b3 100644 --- a/dungeonbattle/tests/interfaces_test.py +++ b/squirrelbattle/tests/interfaces_test.py @@ -1,7 +1,7 @@ import unittest -from dungeonbattle.display.texturepack import TexturePack -from dungeonbattle.interfaces import Map, Tile +from squirrelbattle.display.texturepack import TexturePack +from squirrelbattle.interfaces import Map, Tile class TestInterfaces(unittest.TestCase): @@ -18,7 +18,7 @@ class TestInterfaces(unittest.TestCase): """ Try to load a map from a file. """ - m = Map.load("resources/example_map.txt") + m = Map.load("squirrelbattle/assets/example_map.txt") self.assertEqual(m.width, 52) self.assertEqual(m.height, 17) diff --git a/dungeonbattle/tests/screen.py b/squirrelbattle/tests/screen.py similarity index 100% rename from dungeonbattle/tests/screen.py rename to squirrelbattle/tests/screen.py diff --git a/dungeonbattle/tests/settings_test.py b/squirrelbattle/tests/settings_test.py similarity index 96% rename from dungeonbattle/tests/settings_test.py rename to squirrelbattle/tests/settings_test.py index 9a56048..76bcaba 100644 --- a/dungeonbattle/tests/settings_test.py +++ b/squirrelbattle/tests/settings_test.py @@ -1,6 +1,6 @@ import unittest -from dungeonbattle.settings import Settings +from squirrelbattle.settings import Settings class TestSettings(unittest.TestCase):