Browse Source

run.py: permit load .tmx directly

Bastien Sevajol 8 years ago
parent
commit
5d1e0d740b
1 changed files with 10 additions and 1 deletions
  1. 10 1
      config.py

+ 10 - 1
config.py View File

@@ -4,7 +4,8 @@ import argparse
4 4
 
5 5
 parser = argparse.ArgumentParser(description='Select sandbox.')
6 6
 parser.add_argument('sandbox', metavar='sandbox', type=str, nargs=1,
7
-                    help='Name of sandbox: ' + ', '.join(['exploration', 'all', 'test']))
7
+                    help='Name of sandbox: ' + ', '.join(['exploration', 'all', 'test', 'load']))
8
+parser.add_argument('path', metavar='sandbox', type=str, nargs=1)
8 9
 
9 10
 args = parser.parse_args()
10 11
 
@@ -14,6 +15,14 @@ elif 'exploration' in args.sandbox:
14 15
     from intelligine.sandbox.exploration.exploration import simulations, visualisation as pygame_visualisation
15 16
 elif 'test' in args.sandbox:
16 17
     from intelligine.sandbox.test.test import simulations, visualisation as pygame_visualisation
18
+elif 'load' in args.sandbox:
19
+    from os import getcwd
20
+    from intelligine.display.pygame.config import map_config
21
+    from intelligine.display.pygame.visualisation import get_standard_extract_from_map
22
+
23
+    simulations, pygame_visualisation = get_standard_extract_from_map(getcwd()+args.path[0],
24
+                                                                      map_config)
25
+
17 26
 else:
18 27
     parser.parse_args(['-h'])
19 28