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


Java Bundle.contains方法代码示例

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


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

示例1: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {

	super.restoreFromBundle( bundle );

	if (bundle.contains( CUR )) {

		if (bundle.contains(LENGTH)) {
			cur = new int[bundle.getInt(LENGTH)];
		} else {
			//compatability with pre-0.4.2
			cur = new int[1024];
		}
		off = new int[cur.length];

		int[] data = bundle.getIntArray(CUR);
		int start = bundle.getInt(START);
		for (int i = 0; i < data.length; i++) {
			cur[i + start] = data[i];
			volume += data[i];
		}

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

示例2: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);

	if (bundle.contains("rooms")) {
		rooms = new ArrayList<>(
				(Collection<Room>) ((Collection<?>) bundle
						.getCollection("rooms")));
		for (Room r : rooms) {
			r.onLevelLoad(this);
			if (r instanceof WeakFloorRoom || r.legacyType.equals("WEAK_FLOOR")) {
				weakFloorCreated = true;
				break;
			}
		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:19,代码来源:RegularLevel.java

示例3: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	//logic for pre-0.4.0 saves
	if (bundle.contains( "DR" )){
		//we just assume tier-4 or tier-5 armor was used.
		int DR = bundle.getInt( "DR" );
		if (DR % 5 == 0){
			level((DR - 10)/5);
			armorTier = 5;
		} else {
			level((DR - 8)/4);
			armorTier = 4;
		}
	} else {
		armorTier = bundle.getInt( ARMOR_TIER );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:19,代码来源:ClassArmor.java

示例4: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	quantity	= bundle.getInt( QUANTITY );
	levelKnown	= bundle.getBoolean( LEVEL_KNOWN );
	cursedKnown	= bundle.getBoolean( CURSED_KNOWN );
	
	int level = bundle.getInt( LEVEL );
	if (level > 0) {
		upgrade( level );
	} else if (level < 0) {
		degrade( -level );
	}
	
	cursed	= bundle.getBoolean( CURSED );

	//only want to populate slot on first load.
	if (Dungeon.hero == null) {
		//support for pre-0.2.3 saves and rankings
		if (bundle.contains(OLDSLOT)) {
			Dungeon.quickslot.setSlot(0, this);
		} else if (bundle.contains(QUICKSLOT)) {
			Dungeon.quickslot.setSlot(bundle.getInt(QUICKSLOT), this);
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:26,代码来源:Item.java

示例5: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	sandBags = bundle.getInt(SANDBAGS);

	// these buffs belong to hourglass, need to handle unbundling within the
	// hourglass class.
	if (bundle.contains(BUFF)) {
		Bundle buffBundle = bundle.getBundle(BUFF);

		if (buffBundle.contains(timeFreeze.PARTIALTIME))
			activeBuff = new timeFreeze();
		else
			activeBuff = new timeStasis();

		activeBuff.restoreFromBundle(buffBundle);
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:19,代码来源:TimekeepersHourglass.java

示例6: restoreFromBundle

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

			Bundle node = bundle.getBundle( NODE );
			
			if (!node.isNull() && (spawned = node.getBoolean( SPAWNED ))) {

				//TODO remove when pre-0.3.2 saves are no longer supported
				if (node.contains(TYPE)) {
					type = node.getInt(TYPE);
				} else {
					type = node.getBoolean("alternative")? 1 : 3;
				}
				
				given = node.getBoolean( GIVEN );
				
				wand1 = (Ring)node.get( WAND1 );
				wand2 = (Ring)node.get( WAND2 );

				if (type == 2){
					CeremonialCandle.ritualPos = node.getInt( RITUALPOS );
				}

			} else {
				reset();
			}
		}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:27,代码来源:Wandmaker.java

示例7: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	
	super.restoreFromBundle( bundle );

	if (bundle.contains( CUR )) {

		if (bundle.contains(LENGTH)) {
			cur = new int[bundle.getInt(LENGTH)];
		} else {
			//compatability with pre-0.4.2
			cur = new int[1024];
		}
		off = new int[cur.length];

		int[] data = bundle.getIntArray(CUR);
		int start = bundle.getInt(START);
		for (int i = 0; i < data.length; i++) {
			cur[i + start] = data[i];
			volume += data[i];
		}

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

示例8: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle(bundle);
	if (level() > 0) name = Messages.get(this, "name_" + level());
	if (bundle.contains(SEEDS))
		Collections.addAll(seeds , bundle.getClassArray(SEEDS));
	if (level() == 1)  image = ItemSpriteSheet.ARTIFACT_SHOES;
	else if (level() == 2)  image = ItemSpriteSheet.ARTIFACT_BOOTS;
	else if (level() >= 3)  image = ItemSpriteSheet.ARTIFACT_GREAVES;
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:11,代码来源:SandalsOfNature.java

示例9: 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

示例10: 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

示例11: restoreFromBundle

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

	if (bundle.contains(ARTIFACTS)) {
		Collections.addAll(spawnedArtifacts, bundle.getStringArray(ARTIFACTS));
		Category cat = Category.ARTIFACT;

		for (String artifact : spawnedArtifacts)
			for (int i = 0; i < cat.classes.length; i++)
				if (cat.classes[i].getSimpleName().equals(artifact))
					cat.probs[i] = 0;
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:14,代码来源:Generator.java

示例12: restoreRoomsFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void restoreRoomsFromBundle( Bundle bundle ) {
	if (bundle.contains( ROOMS )) {
		SPECIALS.clear();
		for (String type : bundle.getStringArray( ROOMS )) {
			SPECIALS.add( Type.valueOf( type ));
		}
	} else {
		shuffleTypes();
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:11,代码来源:Room.java

示例13: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	if (bundle.contains(BEAM_TARGET))
		beamTarget = bundle.getInt(BEAM_TARGET);
	beamCooldown = bundle.getInt(BEAM_COOLDOWN);
	beamCharged = bundle.getBoolean(BEAM_CHARGED);
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:9,代码来源:Eye.java

示例14: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {

	if (bundle.contains("width") && bundle.contains("height")) {
		setSize(bundle.getInt("width"), bundle.getInt("height"));
	} else
		setSize(32, 32);

	mobs = new HashSet<Mob>();
	heaps = new SparseArray<Heap>();
	blobs = new HashMap<Class<? extends Blob>, Blob>();
	plants = new SparseArray<Plant>();

	map = bundle.getIntArray(MAP);
	visited = bundle.getBooleanArray(VISITED);
	mapped = bundle.getBooleanArray(MAPPED);

	entrance = bundle.getInt(ENTRANCE);
	exit = bundle.getInt(EXIT);
	currentmoves = bundle.getInt(MOVES);

	locked = bundle.getBoolean(LOCKED);

	cleared = bundle.getBoolean(CLEARED);
	reset = bundle.getBoolean(RESET);
	forcedone = bundle.getBoolean(FORCEDONE);
	genpetnext = bundle.getBoolean(GENPETNEXT);
	sealedlevel = bundle.getBoolean(SEALEDLEVEL);
	viewDistance = bundle.getInt(VIEW);

	weakFloorCreated = false;

	Collection<Bundlable> collection = bundle.getCollection(HEAPS);
	for (Bundlable h : collection) {
		Heap heap = (Heap) h;
		if (!heap.isEmpty())
			heaps.put(heap.pos, heap);
	}

	collection = bundle.getCollection(PLANTS);
	for (Bundlable p : collection) {
		Plant plant = (Plant) p;
		plants.put(plant.pos, plant);
	}

	collection = bundle.getCollection(MOBS);
	for (Bundlable m : collection) {
		Mob mob = (Mob) m;
		if (mob != null) {
			mobs.add(mob);
		}
	}

	collection = bundle.getCollection(BLOBS);
	for (Bundlable b : collection) {
		Blob blob = (Blob) b;
		blobs.put(blob.getClass(), blob);
	}

	feeling = bundle.getEnum(FEELING, Feeling.class);
	if (feeling == Feeling.DARK)
		viewDistance = (int) Math.ceil(viewDistance / 3f);

	buildFlagMaps();
	cleanWalls();
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:67,代码来源:Level.java

示例15: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	if (bundle.contains(FUSE))
		Actor.add(fuse = ((Fuse) bundle.get(FUSE)).ignite(this));
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:7,代码来源:Bomb.java


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