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


Java Bundle类代码示例

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


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

示例1: storeInBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
public static void storeInBundle( Bundle bundle ) {
	
	Bundle node = new Bundle();
	
	node.put( SPAWNED, spawned );
	
	if (spawned) {
		
		node.put( TYPE, type.toString() );
		if (type == Type.ROSE) {
			node.put( LEFT2KILL, left2kill );
		}
		
		node.put( GIVEN, given );
		node.put( DEPTH, depth );
		node.put( PROCESSED, processed );
		
		node.put( WEAPON, weapon );
		node.put( ARMOR, armor );
	}
	
	bundle.put( NODE, node );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:24,代码来源:Ghost.java

示例2: restoreFromBundle

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

	super.restoreFromBundle(bundle);

	heapgenspots = bundle.getIntArray(HEAPGENSPOTS);
	teleportspots = bundle.getIntArray(TELEPORTSPOTS);
	portswitchspots = bundle.getIntArray(PORTSWITCHSPOTS);
	destinationspots = bundle.getIntArray(DESTINATIONSPOTS);
	destinationassign = bundle.getIntArray(DESTINATIONASSIGN);
	teleportassign = bundle.getIntArray(TELEPORTASSIGN);
	prizeNo = bundle.getInt(PRIZENO);

	heapstogen = new HashSet<Item>();

	Collection<Bundlable> collectionheap = bundle.getCollection(HEAPSTOGEN);
	for (Bundlable i : collectionheap) {
		Item item = (Item) i;
		if (item != null) {
			heapstogen.add(item);
		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:24,代码来源:SokobanCastle.java

示例3: restoreFromBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
public void restoreFromBundle( Bundle bundle ) {
	
	backpack.clear();
	backpack.restoreFromBundle( bundle );
	
	weapon = (KindOfWeapon)bundle.get( WEAPON );
	if (weapon != null) {
		weapon.activate( owner );
	}
	
	armor = (Armor)bundle.get( ARMOR );
	
	ring1 = (Ring)bundle.get( RING1 );
	if (ring1 != null) {
		ring1.activate( owner );
	}
	
	ring2 = (Ring)bundle.get( RING2 );
	if (ring2 != null) {
		ring2.activate( owner );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:23,代码来源:Belongings.java

示例4: 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 ))) {

		type = node.getInt(TYPE);
		given	= node.getBoolean( GIVEN );
		processed = node.getBoolean( PROCESSED );

		depth	= node.getInt( DEPTH );
		
		weapon	= (Weapon)node.get( WEAPON );
		armor	= (Armor)node.get( ARMOR );
	} else {
		reset();
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:19,代码来源:Ghost.java

示例5: 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 ))) {
		
		type = node.getEnum( TYPE, Type.class );
		if (type == Type.ILLEGAL) {
			type = node.getBoolean( ALTERNATIVE ) ? Type.RAT : Type.ROSE;
		}
		if (type == Type.ROSE) {
			left2kill = node.getInt( LEFT2KILL );
		}
		
		given	= node.getBoolean( GIVEN );
		depth	= node.getInt( DEPTH );
		processed	= node.getBoolean( PROCESSED );
		
		weapon	= (Weapon)node.get( WEAPON );
		armor	= (Armor)node.get( ARMOR );
	} else {
		reset();
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:25,代码来源:Ghost.java

示例6: restoreFromBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	for (Bundlable item : bundle.getCollection( ITEMS )) {
		if (item != null) ((Item)item).collect( this );
	};
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:8,代码来源:Bag.java

示例7: restoreFromBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	returnDepth = bundle.getInt(DEPTH);
	returnPos = bundle.getInt(POS);
	rooms = bundle.getBooleanArray(ROOMS);
	firsts = bundle.getBooleanArray(FIRSTS);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:OtilukesJournal.java

示例8: restoreFromBundle

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

	for (int i = 0; i < cur.length; i++) {
		if (cur[i] > 0) {
			pos = i;
			break;
		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:12,代码来源:Portal.java

示例9: restore

import com.watabou.utils.Bundle; //导入依赖的package包/类
private static HashSet<Badge> restore(Bundle bundle) {
	HashSet<Badge> badges = new HashSet<>();

	String[] names = bundle.getStringArray(BADGES);
	for (int i = 0; i < names.length; i++) {
		try {
			badges.add(Badge.valueOf(names[i]));
		} catch (Exception e) {
		}
	}

	return badges;
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:14,代码来源:Badges.java

示例10: storeInBundle

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

	super.storeInBundle(bundle);

	heroClass.storeInBundle(bundle);
	subClass.storeInBundle(bundle);

	bundle.put(ATTACK, attackSkill);
	bundle.put(DEFENSE, defenseSkill);

	bundle.put(STRENGTH, STR);

	bundle.put(LEVEL, lvl);
	bundle.put(EXPERIENCE, exp);
	bundle.put(HASPET, haspet);
	bundle.put(PETFOLLOW, petfollow);
	bundle.put(PETTYPE, petType);
	bundle.put(PETLEVEL, petLevel);
	bundle.put(PETKILLS, petKills);
	bundle.put(PETHP, petHP);
	bundle.put(PETEXP, petExperience);
	bundle.put(PETCOOLDOWN, petCooldown);
	bundle.put(PETCOUNT, petCount);

	belongings.storeInBundle(bundle);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:28,代码来源:Hero.java

示例11: storeInBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
@Override
public void storeInBundle(Bundle bundle) {
	super.storeInBundle(bundle);
	bundle.put(DEPTH, returnDepth);
	if (returnDepth != -1) {
		bundle.put(POS, returnPos);
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:TownReturnBeacon.java

示例12: restoreFromBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	arenaDoor = bundle.getInt( DOOR );
	enteredArena = bundle.getBoolean( ENTERED );
	keyDropped = bundle.getBoolean( DROPPED );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:8,代码来源:CityBossLevel.java

示例13: storeInBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
@Override
public void storeInBundle( Bundle bundle ) {
	super.storeInBundle( bundle );
	bundle.put( ARENA, roomExit );
	bundle.put( DOOR, arenaDoor );
	bundle.put( ENTERED, enteredArena );
	bundle.put( DROPPED, keyDropped );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:9,代码来源:PrisonBossLevel.java

示例14: ItemStatusHandler

import com.watabou.utils.Bundle; //导入依赖的package包/类
public ItemStatusHandler(Class<? extends T>[] items, String[] labels,
                         Integer[] images, Bundle bundle) {

	this.items = items;

	this.images = new HashMap<Class<? extends T>, Integer>();
	this.labels = new HashMap<Class<? extends T>, String>();
	known = new HashSet<Class<? extends T>>();

	restore(bundle, labels, images);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:12,代码来源:ItemStatusHandler.java

示例15: storeInBundle

import com.watabou.utils.Bundle; //导入依赖的package包/类
@Override
public void storeInBundle(Bundle bundle) {
	super.storeInBundle(bundle);
	bundle.put(PARTIALCHARGE, partialCharge);
	bundle.put(CHARGE, charge);
	bundle.put(CONSUMED, consumedpts);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:8,代码来源:RingOfFrost.java


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