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


Java Bundle.getString方法代码示例

本文整理汇总了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);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:25,代码来源:Mob.java

示例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 );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:23,代码来源:Mob.java

示例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 );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:21,代码来源:Mob.java

示例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" );
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:10,代码来源:Room.java

示例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());
	}

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

示例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));
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:8,代码来源:SandalsOfNature.java

示例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);
				}
			}
		}
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:47,代码来源:ItemStatusHandler.java

示例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 );

}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:42,代码来源:Rankings.java

示例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 );
			
		}
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:38,代码来源:ItemStatusHandler.java


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