File tree 3 files changed +33
-9
lines changed
addons/source-python/packages/source-python 3 files changed +33
-9
lines changed Original file line number Diff line number Diff line change 5
5
# =============================================================================
6
6
# >> IMPORTS
7
7
# =============================================================================
8
+ # Python Imports
9
+ # Importlib
8
10
from importlib import import_module
11
+
12
+ # Source.Python Imports
13
+ # Core
9
14
from core import GAME_NAME
10
15
from core import SOURCE_ENGINE
16
+ # Entities
17
+ import entities ._base
18
+ # Paths
11
19
from paths import SP_PACKAGES_PATH
12
20
13
21
35
43
).isfile ():
36
44
37
45
# Import the game-specific 'Entity' class
38
- Entity = import_module (
46
+ Entity = entities . _base = import_module (
39
47
'entities.engines.{engine}.{game}' .format (
40
48
engine = SOURCE_ENGINE ,
41
49
game = GAME_NAME ,
47
55
).isfile ():
48
56
49
57
# Import the engine-specific 'Entity' class
50
- Entity = import_module (
58
+ Entity = entities . _base = import_module (
51
59
'entities.engines.{engine}' .format (
52
60
engine = SOURCE_ENGINE ,
53
61
)
56
64
else :
57
65
58
66
# Import the base 'Entity' class
59
- from entities ._base import Entity
67
+ Entity = entities ._base . Entity
Original file line number Diff line number Diff line change 5
5
# =============================================================================
6
6
# >> IMPORTS
7
7
# =============================================================================
8
+ # Python Imports
9
+ # Importlib
8
10
from importlib import import_module
11
+
12
+ # Source.Python Imports
13
+ # Core
9
14
from core import GAME_NAME
10
15
from core import SOURCE_ENGINE
16
+ # Paths
11
17
from paths import SP_PACKAGES_PATH
18
+ # Players
19
+ import players ._base
12
20
13
21
14
22
# =============================================================================
26
34
).isfile ():
27
35
28
36
# Import the game-specific 'Player' class
29
- Player = import_module (
37
+ Player = players . _base . Player = import_module (
30
38
'players.engines.{engine}.{game}' .format (
31
39
engine = SOURCE_ENGINE ,
32
40
game = GAME_NAME ,
38
46
).isfile ():
39
47
40
48
# Import the engine-specific 'Player' class
41
- Player = import_module (
49
+ Player = players . _base . Player = import_module (
42
50
'players.engines.{engine}' .format (
43
51
engine = SOURCE_ENGINE ,
44
52
)
47
55
else :
48
56
49
57
# Import the base 'Player' class
50
- from players ._base import Player
58
+ Player = players ._base . Player
Original file line number Diff line number Diff line change 5
5
# =============================================================================
6
6
# >> IMPORTS
7
7
# =============================================================================
8
+ # Python Imports
9
+ # Importlib
8
10
from importlib import import_module
11
+
12
+ # Source.Python Imports
13
+ # Core
9
14
from core import GAME_NAME
10
15
from core import SOURCE_ENGINE
16
+ # Paths
11
17
from paths import SP_PACKAGES_PATH
18
+ # Weapons
19
+ import weapons ._base
12
20
13
21
14
22
# =============================================================================
26
34
).isfile ():
27
35
28
36
# Import the game-specific 'Weapon' class
29
- Weapon = import_module (
37
+ Weapon = weapons . _base = import_module (
30
38
'weapons.engines.{engine}.{game}' .format (
31
39
engine = SOURCE_ENGINE ,
32
40
game = GAME_NAME ,
38
46
).isfile ():
39
47
40
48
# Import the engine-specific 'Weapon' class
41
- Weapon = import_module (
49
+ Weapon = weapons . _base = import_module (
42
50
'weapons.engines.{engine}' .format (
43
51
engine = SOURCE_ENGINE ,
44
52
)
47
55
else :
48
56
49
57
# Import the base 'Weapon' class
50
- from weapons ._base import Weapon
58
+ Weapon = weapons ._base . Weapon
You can’t perform that action at this time.
0 commit comments