Example #1
0
	savePath = Filename( 'saveData/' )

	files = { 'main': Filename('config/settings.cfg') }
	configs = {}

	for s in ['players', 'playerIds', 'blockTypes', 'blockTypeIds']:
		files[ s ] = savePath + s + '.dat'

	for name, filename in files.items(): files[name] = FileObject( filename )
	for name, fileObj in files.items(): configs[ name ] = Config( fileObj )
	for config in configs.values(): config.process()

	scene = Scene()

	playerFactory = PlayerFactory( configs['players'], configs['playerIds'] )
	blockTypeFactory = BlockTypeFactory( configs['blockTypes']
			, configs['blockTypeIds'], scene.loader
			)

	playerFactory.process()
	blockTypeFactory.process()

	world = World( configs['main'], playerFactory, blockTypeFactory )
	world.setup()

	# assume we are at position (0, 0, 0)
	for chunk in world.getChunks( Vec3(0, 0, 0) ): chunk.load( scene.render )

	scene.run()