当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.write方法代码示例

本文整理汇总了Java中com.watabou.utils.Bundle.write方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.write方法的具体用法?Java Bundle.write怎么用?Java Bundle.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.watabou.utils.Bundle的用法示例。


在下文中一共展示了Bundle.write方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveGlobal

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void saveGlobal() {
	if (saveNeeded) {

		Bundle bundle = new Bundle();
		store(bundle, global);

		try {
			OutputStream output = Game.instance.openFileOutput(BADGES_FILE,
					Context.MODE_PRIVATE);
			Bundle.write(bundle, output);
			File file = new File(TextureCache.context.getExternalFilesDir(null), BADGES_FILE);
			Bundle.writeext(bundle, file);
			output.close();
			saveNeeded = false;
		} catch (IOException e) {

		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:20,代码来源:Badges.java

示例2: saveGlobal

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void saveGlobal() {
	if (saveNeeded) {
		
		Bundle bundle = new Bundle();
		store( bundle, global );
		
		try {
			OutputStream output = Game.instance.openFileOutput( BADGES_FILE, Game.MODE_PRIVATE );
			Bundle.write( bundle, output );
			output.close();
			saveNeeded = false;
		} catch (IOException e) {
			UNISTPixelDungeon.reportException(e);
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:17,代码来源:Badges.java

示例3: leave

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void leave() {

		depth = Dungeon.depth;

		//heroes which have won the game, who die far above their farthest depth, or who are challenged drop no bones.
		if (Statistics.amuletObtained || (Statistics.deepestFloor - 5) >= depth || Dungeon.challenges > 0) {
			depth = -1;
			return;
		}

		item = pickItem(Dungeon.hero);

		Bundle bundle = new Bundle();
		bundle.put( LEVEL, depth );
		bundle.put( ITEM, item );

		try {
			OutputStream output = Game.instance.openFileOutput( BONES_FILE, Game.MODE_PRIVATE );
			Bundle.write( bundle, output );
			output.close();
		} catch (IOException e) {
			UNISTPixelDungeon.reportException(e);
		}
	}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:25,代码来源:Bones.java

示例4: saveLevel

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void saveLevel() throws IOException {
	Bundle bundle = new Bundle();
	bundle.put(LEVEL, level);

	OutputStream output = Game.instance.openFileOutput(
			Utils.format(depthFile(hero.heroClass), depth),
			Context.MODE_PRIVATE);
	Bundle.write(bundle, output);
	File file = new File(TextureCache.context.getExternalFilesDir(null), Utils.format(depthFile(hero.heroClass), depth));
	Bundle.writeext(bundle, file);
	output.close();
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:13,代码来源:Dungeon.java

示例5: leave

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void leave() {

		depth = Dungeon.depth;

		// heroes which have won the game, who die far above their farthest
		// depth, or who are challenged drop no bones.
		if (Statistics.amuletObtained || (Statistics.deepestFloor - 5) >= depth
				|| Dungeon.challenges > 0) {
			depth = -1;
			return;
		}

		item = pickItem(Dungeon.hero);

		Bundle bundle = new Bundle();
		bundle.put(LEVEL, depth);
		bundle.put(ITEM, item);

		try {
			OutputStream output = Game.instance.openFileOutput(BONES_FILE,
					Context.MODE_PRIVATE);
			Bundle.write(bundle, output);
			File file = new File(TextureCache.context.getExternalFilesDir(null), BONES_FILE);
			Bundle.writeext(bundle, file);
			output.close();
		} catch (IOException e) {

		}
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:30,代码来源:Bones.java

示例6: saveLevel

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void saveLevel() throws IOException {
	Bundle bundle = new Bundle();
	bundle.put( LEVEL, level );
	
	OutputStream output = Game.instance.openFileOutput(
		Messages.format( depthFile( hero.heroClass ), depth ), Game.MODE_PRIVATE );
	Bundle.write( bundle, output );
	output.close();
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:10,代码来源:Dungeon.java

示例7: saveLevel

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void saveLevel() throws IOException {
	Bundle bundle = new Bundle();
	bundle.put( LEVEL, level );
	
	OutputStream output = Game.instance.openFileOutput( Utils.format( depthFile( hero.heroClass ), depth ));
	Bundle.write( bundle, output );
	output.close();
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:9,代码来源:Dungeon.java

示例8: saveGame

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void saveGame( String fileName ) throws IOException {
	try {
		Bundle bundle = new Bundle();
		
		bundle.put( VERSION, Game.version );
		bundle.put( CHALLENGES, challenges );
		bundle.put( HERO, hero );
		bundle.put( GOLD, gold );
		bundle.put( DEPTH, depth );
		
		for (int d : droppedItems.keyArray()) {
			bundle.put( Utils.format( DROPPED, d ), droppedItems.get( d ) );
		}
		
		bundle.put( POS, potionOfStrength );
		bundle.put( SOU, scrollsOfUpgrade );
		bundle.put( SOE, scrollsOfEnchantment );
		bundle.put( DV, dewVial );
		
		int count = 0;
		int ids[] = new int[chapters.size()];
		for (Integer id : chapters) {
			ids[count++] = id;
		}
		bundle.put( CHAPTERS, ids );
		
		Bundle quests = new Bundle();
		Ghost		.Quest.storeInBundle( quests );
		Wandmaker	.Quest.storeInBundle( quests );
		Blacksmith	.Quest.storeInBundle( quests );
		Imp			.Quest.storeInBundle( quests );
		bundle.put( QUESTS, quests );
		
		Room.storeRoomsInBundle( bundle );
		
		Statistics.storeInBundle( bundle );
		Journal.storeInBundle( bundle );
		
		QuickSlot.save( bundle );
		
		Scroll.save( bundle );
		Potion.save( bundle );
		Wand.save( bundle );
		Ring.save( bundle );
		
		Bundle badges = new Bundle();
		Badges.saveLocal( badges );
		bundle.put( BADGES, badges );
		
		OutputStream output = Game.instance.openFileOutput( fileName);
		Bundle.write( bundle, output );
		output.close();
		
	} catch (Exception e) {

		GamesInProgress.setUnknown( hero.heroClass );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:59,代码来源:Dungeon.java


注:本文中的com.watabou.utils.Bundle.write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。