瀏覽代碼

rename gui into game module

Bastien Sevajol 6 年之前
父節點
當前提交
da08b885c2

opencombat/gui/__init__.py → opencombat/game/__init__.py 查看文件


opencombat/gui/actor.py → opencombat/game/actor.py 查看文件

@@ -14,17 +14,17 @@ from synergine2_xyz.exception import UnknownAnimationIndex
14 14
 from opencombat.exception import UnknownWeapon
15 15
 from opencombat.exception import WrongMode
16 16
 from opencombat.exception import UnknownFiringAnimation
17
-from opencombat.gui.animation import ANIMATION_CRAWL
18
-from opencombat.gui.animation import ANIMATION_WALK
19
-from opencombat.gui.const import MODE_MAN_STAND_UP
20
-from opencombat.gui.const import MODE_MAN_CRAWLING
21
-from opencombat.gui.image import TileImageCacheManager
22
-from opencombat.gui.weapon import RIFFLE
23
-from opencombat.gui.weapon import WeaponImageApplier
17
+from opencombat.game.animation import ANIMATION_CRAWL
18
+from opencombat.game.animation import ANIMATION_WALK
19
+from opencombat.game.const import MODE_MAN_STAND_UP
20
+from opencombat.game.const import MODE_MAN_CRAWLING
21
+from opencombat.game.image import TileImageCacheManager
22
+from opencombat.game.weapon import RIFFLE
23
+from opencombat.game.weapon import WeaponImageApplier
24 24
 from opencombat.user_action import UserAction
25 25
 
26 26
 if typing.TYPE_CHECKING:
27
-    from opencombat.gui.fire import GuiFiringEvent
27
+    from opencombat.game.fire import GuiFiringEvent
28 28
 
29 29
 
30 30
 MODE_DEFAULT = 'MODE_DEFAULT'

opencombat/gui/animation.py → opencombat/game/animation.py 查看文件


opencombat/gui/base.py → opencombat/game/base.py 查看文件

@@ -18,11 +18,11 @@ from synergine2_cocos2d.interaction import InteractionManager
18 18
 from synergine2_cocos2d.middleware import MapMiddleware
19 19
 from synergine2_cocos2d.util import PathManager
20 20
 
21
-from opencombat.gui.animation import ANIMATION_WALK
22
-from opencombat.gui.animation import ANIMATION_CRAWL
23
-from opencombat.gui.fire import GuiFiringEvent
24
-from opencombat.gui.placement import SetSubjectPositionsInteraction
25
-from opencombat.gui.state import SaveStateInteraction
21
+from opencombat.game.animation import ANIMATION_WALK
22
+from opencombat.game.animation import ANIMATION_CRAWL
23
+from opencombat.game.fire import GuiFiringEvent
24
+from opencombat.game.placement import SetSubjectPositionsInteraction
25
+from opencombat.game.state import SaveStateInteraction
26 26
 from opencombat.simulation.interior import InteriorManager
27 27
 from opencombat.simulation.tmx import TileMap
28 28
 from opencombat.user_action import UserAction
@@ -45,8 +45,8 @@ from opencombat.simulation.event import FireEvent
45 45
 from opencombat.simulation.event import DieEvent
46 46
 from opencombat.simulation.subject import ManSubject
47 47
 from opencombat.simulation.subject import TankSubject
48
-from opencombat.gui.actor import Man as ManActor
49
-from opencombat.gui.actor import HeavyVehicle as HeavyVehicleActor
48
+from opencombat.game.actor import Man as ManActor
49
+from opencombat.game.actor import HeavyVehicle as HeavyVehicleActor
50 50
 
51 51
 
52 52
 class EditLayer(BaseEditLayer):
@@ -290,10 +290,10 @@ class Game(TMXGui):
290 290
         )
291 291
 
292 292
     def before_run(self) -> None:
293
-        from opencombat.gui.move import MoveActorInteraction
294
-        from opencombat.gui.move import MoveFastActorInteraction
295
-        from opencombat.gui.move import MoveCrawlActorInteraction
296
-        from opencombat.gui.fire import FireActorInteraction
293
+        from opencombat.game.move import MoveActorInteraction
294
+        from opencombat.game.move import MoveFastActorInteraction
295
+        from opencombat.game.move import MoveCrawlActorInteraction
296
+        from opencombat.game.fire import FireActorInteraction
297 297
 
298 298
         self.layer_manager.interaction_manager.register(
299 299
             MoveActorInteraction,

opencombat/gui/const.py → opencombat/game/const.py 查看文件


opencombat/gui/fire.py → opencombat/game/fire.py 查看文件

@@ -1,7 +1,7 @@
1 1
 # coding: utf-8
2 2
 import typing
3 3
 
4
-from opencombat.gui.actor import BaseActor
4
+from opencombat.game.actor import BaseActor
5 5
 from opencombat.simulation.event import DEFAULT_WEAPON_TYPE
6 6
 from opencombat.simulation.fire import RequestFireBehaviour
7 7
 from synergine2_cocos2d.interaction import BaseActorInteraction

opencombat/gui/image.py → opencombat/game/image.py 查看文件

@@ -12,7 +12,7 @@ from opencombat.exception import UnknownWeapon
12 12
 from opencombat.exception import UnknownFiringAnimation
13 13
 
14 14
 if typing.TYPE_CHECKING:
15
-    from opencombat.gui.actor import BaseActor
15
+    from opencombat.game.actor import BaseActor
16 16
 
17 17
 
18 18
 class FiringImageCache(ImageCache):
@@ -72,7 +72,7 @@ class TileImageCacheManager(ImageCacheManager):
72 72
     ) -> None:
73 73
         super().__init__(actor, config)
74 74
         self.firing_cache = FiringImageCache()
75
-        from opencombat.gui.actor import BaseActor
75
+        from opencombat.game.actor import BaseActor
76 76
         self.actor = typing.cast(BaseActor, self.actor)
77 77
         self.path_manager = PathManager(
78 78
             self.config.resolve('global.include_path.graphics'),

opencombat/gui/move.py → opencombat/game/move.py 查看文件


opencombat/gui/placement.py → opencombat/game/placement.py 查看文件


opencombat/gui/state.py → opencombat/game/state.py 查看文件


opencombat/gui/weapon.py → opencombat/game/weapon.py 查看文件

@@ -8,11 +8,11 @@ from synergine2.config import Config
8 8
 from synergine2_cocos2d.util import PathManager
9 9
 
10 10
 from opencombat.exception import UnknownWeapon
11
-from opencombat.gui.const import MODE_MAN_STAND_UP
12
-from opencombat.gui.const import MODE_MAN_CRAWLING
11
+from opencombat.game.const import MODE_MAN_STAND_UP
12
+from opencombat.game.const import MODE_MAN_CRAWLING
13 13
 
14 14
 if typing.TYPE_CHECKING:
15
-    from opencombat.gui.actor import BaseActor
15
+    from opencombat.game.actor import BaseActor
16 16
 
17 17
 RIFFLE = 'RIFFLE'
18 18
 

+ 1 - 1
opencombat/terminal/base.py 查看文件

@@ -39,7 +39,7 @@ class CocosTerminal(GameTerminal):
39 39
         self.map_dir_path = map_dir_path
40 40
 
41 41
     def run(self):
42
-        from opencombat.gui.base import Game
42
+        from opencombat.game.base import Game
43 43
 
44 44
         self.gui = Game(
45 45
             self.config,