本文整理汇总了Java中com.watabou.utils.Bundle.getClass方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getClass方法的具体用法?Java Bundle.getClass怎么用?Java Bundle.getClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.utils.Bundle
的用法示例。
在下文中一共展示了Bundle.getClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
//conversion logic for pre-0.3.4 saves
if (bundle.contains( REASON )){
String info = bundle.getString( REASON ).toLowerCase(Locale.ENGLISH);
if (info.equals("obtained the amulet of yendor")) cause = Amulet.class;
else if (info.contains("goo")) cause = Goo.class;
else if (info.contains("tengu")) cause = Tengu.class;
else if (info.contains("dm-300")) cause = DM300.class;
else if (info.contains("king")) cause = King.class;
else if (info.contains("yog")) cause = Yog.class;
else if (info.contains("fist")) cause = Yog.class;
else if (info.contains("larva")) cause = Yog.class;
else if (info.equals("burned to ash")) cause = Burning.class;
else if (info.equals("starved to death")) cause = Hunger.class;
else if (info.equals("succumbed to poison")) cause = Poison.class;
else if (info.equals("suffocated")) cause = ToxicGas.class;
else if (info.equals("bled to death")) cause = Bleeding.class;
else if (info.equals("melted away")) cause = Ooze.class;
else if (info.equals("died on impact")) cause = Chasm.class;
//can't get the all, just keep what remains as-is
else this.info = info;
} else {
cause = bundle.getClass( CAUSE );
}
win = bundle.getBoolean( WIN );
score = bundle.getInt( SCORE );
heroClass = HeroClass.restoreInBundle( bundle );
armorTier = bundle.getInt( TIER );
if (bundle.contains(FILE)) gameFile = bundle.getString(FILE);
if (bundle.contains(DATA)) gameData = bundle.getBundle(DATA);
if (bundle.contains(ID)) gameID = bundle.getString(ID);
depth = bundle.getInt( DEPTH );
herolevel = bundle.getInt( LEVEL );
}