本文整理汇总了Java中com.watabou.utils.Bundle.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getString方法的具体用法?Java Bundle.getString怎么用?Java Bundle.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.utils.Bundle
的用法示例。
在下文中一共展示了Bundle.getString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
String state = bundle.getString(STATE);
if (state.equals(Sleeping.TAG)) {
this.state = SLEEPING;
} else if (state.equals(Wandering.TAG)) {
this.state = WANDERING;
} else if (state.equals(Hunting.TAG)) {
this.state = HUNTING;
} else if (state.equals(Fleeing.TAG)) {
this.state = FLEEING;
} else if (state.equals(Passive.TAG)) {
this.state = PASSIVE;
}
enemySeen = bundle.getBoolean(SEEN);
target = bundle.getInt(TARGET);
originalgen = bundle.getBoolean(ORIGINAL);
}
示例2: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
String state = bundle.getString( STATE );
if (state.equals( Sleeping.TAG )) {
this.state = SLEEPING;
} else if (state.equals( Wandering.TAG )) {
this.state = WANDERING;
} else if (state.equals( Hunting.TAG )) {
this.state = HUNTING;
} else if (state.equals( Fleeing.TAG )) {
this.state = FLEEING;
} else if (state.equals( Passive.TAG )) {
this.state = PASSIVE;
}
enemySeen = bundle.getBoolean( SEEN );
target = bundle.getInt( TARGET );
}
示例3: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
String state = bundle.getString( STATE );
if (state.equals( Sleeping.TAG )) {
this.state = SLEEPEING;
} else if (state.equals( Wandering.TAG )) {
this.state = WANDERING;
} else if (state.equals( Hunting.TAG )) {
this.state = HUNTING;
} else if (state.equals( Fleeing.TAG )) {
this.state = FLEEING;
} else if (state.equals( Passive.TAG )) {
this.state = PASSIVE;
}
target = bundle.getInt( TARGET );
}
示例4: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
left = bundle.getInt("left");
top = bundle.getInt("top");
right = bundle.getInt("right");
bottom = bundle.getInt("bottom");
if (bundle.contains( "type" ))
legacyType = bundle.getString( "type" );
}
示例5: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
if (bundle.contains(POTIONATTRIB)) {
imbuePotion((Potion) bundle.get(POTIONATTRIB));
} else if (bundle.contains("name")) {
name = bundle.getString("name");
if (name.equals("Healthfruit"))
cook(new Sungrass.Seed());
else if (name.equals("Powerfruit"))
cook(new Wandmaker.Rotberry.Seed());
else if (name.equals("Paralyzefruit"))
cook(new Earthroot.Seed());
else if (name.equals("Invisifruit"))
cook(new Blindweed.Seed());
else if (name.equals("Flamefruit"))
cook(new Firebloom.Seed());
else if (name.equals("Frostfruit"))
cook(new Icecap.Seed());
else if (name.equals("Visionfruit"))
cook(new Fadeleaf.Seed());
else if (name.equals("Toxicfruit"))
cook(new Sorrowmoss.Seed());
else if (name.equals("Floatfruit"))
cook(new Stormvine.Seed());
else if (name.equals("Purefruit"))
cook(new Dreamfoil.Seed());
else if (name.equals("Mightyfruit"))
cook(new Phaseshift.Seed());
else if (name.equals("Heartfruit"))
cook(new Flytrap.Seed());
}
}
示例6: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
name = bundle.getString(NAME);
if (bundle.contains(SEEDS))
Collections.addAll(seeds, bundle.getStringArray(SEEDS));
}
示例7: restore
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
private void restore(Bundle bundle, String[] allLabels, Integer[] allImages) {
ArrayList<String> labelsLeft = new ArrayList<String>(
Arrays.asList(allLabels));
ArrayList<Integer> imagesLeft = new ArrayList<Integer>(
Arrays.asList(allImages));
for (int i = 0; i < items.length; i++) {
Class<? extends T> item = (items[i]);
String itemName = item.toString();
if (bundle.contains(itemName + PFX_LABEL) && Dungeon.version > 4) {
String label = bundle.getString(itemName + PFX_LABEL);
labels.put(item, label);
labelsLeft.remove(label);
Integer image = bundle.getInt(itemName + PFX_IMAGE);
images.put(item, image);
imagesLeft.remove(image);
if (bundle.getBoolean(itemName + PFX_KNOWN)) {
known.add(item);
}
// if there's a new item, give it a random image
// or.. if we're loading from an untrusted version, randomize
// the image to be safe.
} else {
int index = Random.Int(labelsLeft.size());
labels.put(item, labelsLeft.get(index));
labelsLeft.remove(index);
images.put(item, imagesLeft.get(index));
imagesLeft.remove(index);
if (bundle.contains(itemName + PFX_KNOWN)
&& bundle.getBoolean(itemName + PFX_KNOWN)) {
known.add(item);
}
}
}
}
示例8: 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 );
}
示例9: restore
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
private void restore( Bundle bundle, String[] allLabels, Integer[] allImages ) {
ArrayList<String> labelsLeft = new ArrayList<String>( Arrays.asList( allLabels ) );
ArrayList<Integer> imagesLeft = new ArrayList<Integer>( Arrays.asList( allImages ) );
for (int i=0; i < items.length; i++) {
Class<? extends T> item = (Class<? extends T>)(items[i]);
String itemName = item.toString();
if (bundle.contains( itemName + PFX_LABEL )) {
String label = bundle.getString( itemName + PFX_LABEL );
labels.put( item, label );
labelsLeft.remove( label );
Integer image = bundle.getInt( itemName + PFX_IMAGE );
images.put( item, image );
imagesLeft.remove( image );
if (bundle.getBoolean( itemName + PFX_KNOWN )) {
known.add( item );
}
} else {
int index = Random.Int( labelsLeft.size() );
labels.put( item, labelsLeft.get( index ) );
labelsLeft.remove( index );
images.put( item, imagesLeft.get( index ) );
imagesLeft.remove( index );
}
}
}