-
Notifications
You must be signed in to change notification settings - Fork 0
/
__main__.py
40 lines (31 loc) · 1.22 KB
/
__main__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import argparse
import os
import sys
import wx
import switchpanel as sp
import src
import data
import view
class MainFrame( sp.SwitchFrame ):
def init_ui( self, world ):
self.world = world
self.SetSize( (800, 600) )
self.add_panel( "map", view.MapPanel( self, self.world ) )
self.add_panel( "location", view.LocationPanel( self, self.world ) )
self.set_active( "map" )
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--save_points", help="save point map to file")
parser.add_argument("--point_map_file", help="load point map from specified file")
parser.add_argument("--num_points", help="number of location points to generate",
type=int, default=1000 )
args = parser.parse_args()
point_file = os.path.abspath(args.point_map_file) if args.point_map_file else ""
#sys.setrecursionlimit(100)
world = src.world.World( args.num_points, src.player.Player(), point_file )
if args.save_points:
world.save_points_to_file( os.path.abspath(args.save_points) )
app = wx.App(False)
frame = MainFrame(world)
frame.Show()
app.MainLoop()