Ejemplo n.º 1
0
	def setUp(self):
		''' '''

		self.chunkSize = 4
		self.playerFactory = PlayerFactorySetup.create()
		self.blockTypeFactory = BlockTypeFactorySetup.create()

		self.encoder = EncoderSetup.create( blockTypeFactory = self.blockTypeFactory
				, playerFactory = self.playerFactory
				)
		self.generator = ChunkGeneratorSetup.create( chunkSize = self.chunkSize
				, playerFactory = self.playerFactory
				, blockTypeFactory = self.blockTypeFactory
				)
		self.position = Vec3( 0, 0, 0 )
		self.fileObj = ChunkFileSetup.create()

		self.chunk = ChunkSetup.create( fileObj = self.fileObj, encoder = self.encoder
				, generator = self.generator, chunkSize = self.chunkSize
				, position = self.position
				)

		node = NodePath()
		self.chunk.load( node )

		world = self.playerFactory.fromName( '__WORLD__' )
		dirtType = self.blockTypeFactory.fromName( 'dirt' )
		self.dirt = dirtType.newBlock( world )

		return None
Ejemplo n.º 2
0
	def setUp(self):
		''' '''
		self.chunkSize = 16
		self.playerFactory = PlayerFactorySetup.create()
		self.blockTypeFactory = BlockTypeFactorySetup.create()

		self.encoder = EncoderSetup.create( blockTypeFactory = self.blockTypeFactory
				, playerFactory = self.playerFactory
				)
		self.generator = ChunkGeneratorSetup.create( chunkSize = self.chunkSize
				, playerFactory = self.playerFactory
				, blockTypeFactory = self.blockTypeFactory
				)
		self.position = Vec3( 0, 0, 0 )
		self.fileObj = FileObjectMock()

		self.chunk = ChunkSetup.create( fileObj = self.fileObj, encoder = self.encoder
				, generator = self.generator, chunkSize = self.chunkSize
				, position = self.position
				)
		return None