Browse Source

rename gui into game module

Bastien Sevajol 6 years ago
parent
commit
da08b885c2

opencombat/gui/__init__.py → opencombat/game/__init__.py View File


opencombat/gui/actor.py → opencombat/game/actor.py View File

14
 from opencombat.exception import UnknownWeapon
14
 from opencombat.exception import UnknownWeapon
15
 from opencombat.exception import WrongMode
15
 from opencombat.exception import WrongMode
16
 from opencombat.exception import UnknownFiringAnimation
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
 from opencombat.user_action import UserAction
24
 from opencombat.user_action import UserAction
25
 
25
 
26
 if typing.TYPE_CHECKING:
26
 if typing.TYPE_CHECKING:
27
-    from opencombat.gui.fire import GuiFiringEvent
27
+    from opencombat.game.fire import GuiFiringEvent
28
 
28
 
29
 
29
 
30
 MODE_DEFAULT = 'MODE_DEFAULT'
30
 MODE_DEFAULT = 'MODE_DEFAULT'

opencombat/gui/animation.py → opencombat/game/animation.py View File


opencombat/gui/base.py → opencombat/game/base.py View File

18
 from synergine2_cocos2d.middleware import MapMiddleware
18
 from synergine2_cocos2d.middleware import MapMiddleware
19
 from synergine2_cocos2d.util import PathManager
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
 from opencombat.simulation.interior import InteriorManager
26
 from opencombat.simulation.interior import InteriorManager
27
 from opencombat.simulation.tmx import TileMap
27
 from opencombat.simulation.tmx import TileMap
28
 from opencombat.user_action import UserAction
28
 from opencombat.user_action import UserAction
45
 from opencombat.simulation.event import DieEvent
45
 from opencombat.simulation.event import DieEvent
46
 from opencombat.simulation.subject import ManSubject
46
 from opencombat.simulation.subject import ManSubject
47
 from opencombat.simulation.subject import TankSubject
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
 class EditLayer(BaseEditLayer):
52
 class EditLayer(BaseEditLayer):
290
         )
290
         )
291
 
291
 
292
     def before_run(self) -> None:
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
         self.layer_manager.interaction_manager.register(
298
         self.layer_manager.interaction_manager.register(
299
             MoveActorInteraction,
299
             MoveActorInteraction,

opencombat/gui/const.py → opencombat/game/const.py View File


opencombat/gui/fire.py → opencombat/game/fire.py View File

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

opencombat/gui/image.py → opencombat/game/image.py View File

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

opencombat/gui/move.py → opencombat/game/move.py View File


opencombat/gui/placement.py → opencombat/game/placement.py View File


opencombat/gui/state.py → opencombat/game/state.py View File


opencombat/gui/weapon.py → opencombat/game/weapon.py View File

8
 from synergine2_cocos2d.util import PathManager
8
 from synergine2_cocos2d.util import PathManager
9
 
9
 
10
 from opencombat.exception import UnknownWeapon
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
 if typing.TYPE_CHECKING:
14
 if typing.TYPE_CHECKING:
15
-    from opencombat.gui.actor import BaseActor
15
+    from opencombat.game.actor import BaseActor
16
 
16
 
17
 RIFFLE = 'RIFFLE'
17
 RIFFLE = 'RIFFLE'
18
 
18
 

+ 1 - 1
opencombat/terminal/base.py View File

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