本文整理汇总了Java中com.watabou.utils.Bundle.read方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.read方法的具体用法?Java Bundle.read怎么用?Java Bundle.read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.utils.Bundle
的用法示例。
在下文中一共展示了Bundle.read方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadGlobal
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void loadGlobal() {
if (global == null) {
try {
InputStream input = Game.instance.openFileInput(BADGES_FILE);
Bundle bundle = Bundle.read(input);
input.close();
global = restore(bundle);
} catch (Exception e) {
global = new HashSet<>();
}
}
}
示例2: gameBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static Bundle gameBundle(String fileName) throws IOException {
InputStream input = Game.instance.openFileInput(fileName);
Bundle bundle = Bundle.read(input);
input.close();
return bundle;
}
示例3: loadGlobal
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void loadGlobal() {
if (global == null) {
try {
InputStream input = Game.instance.openFileInput( BADGES_FILE );
Bundle bundle = Bundle.read( input );
input.close();
global = restore( bundle );
} catch (IOException e) {
global = new HashSet<Badge>();
}
}
}
示例4: loadLevel
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static Level loadLevel( HeroClass cl ) throws IOException {
Dungeon.level = null;
Actor.clear();
InputStream input = Game.instance.openFileInput( Messages.format( depthFile( cl ), depth ) ) ;
Bundle bundle = Bundle.read( input );
input.close();
return (Level)bundle.get( "level" );
}
示例5: gameBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static Bundle gameBundle( String fileName ) throws IOException {
InputStream input = Game.instance.openFileInput( fileName );
Bundle bundle = Bundle.read( input );
input.close();
return bundle;
}
示例6: loadLevel
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static Level loadLevel( HeroClass cl ) throws IOException {
Dungeon.level = null;
Actor.clear();
InputStream input = Game.instance.openFileInput( Utils.format( depthFile( cl ), depth ) ) ;
Bundle bundle = Bundle.read( input );
input.close();
return (Level)bundle.get( "level" );
}
示例7: get
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static Item get() {
if (depth == -1) {
try {
InputStream input = Game.instance.openFileInput( BONES_FILE ) ;
Bundle bundle = Bundle.read( input );
input.close();
depth = bundle.getInt( LEVEL );
item = (Item)bundle.get( ITEM );
return get();
} catch (IOException e) {
return null;
}
} else {
if (depth == Dungeon.depth) {
Game.instance.deleteFile( BONES_FILE );
depth = 0;
if (!item.stackable) {
item.cursed = true;
item.cursedKnown = true;
if (item.isUpgradable()) {
int lvl = (Dungeon.depth - 1) * 3 / 5 + 1;
if (lvl < item.level()) {
item.degrade( item.level() - lvl );
}
item.levelKnown = false;
}
}
if (item instanceof Ring) {
((Ring)item).syncGem();
}
return item;
} else {
return null;
}
}
}