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


Java Bundle.getCollection方法代码示例

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


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

示例1: restoreFromBundle

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

	rooms = new ArrayList<>( (Collection<Room>) ((Collection<?>) bundle.getCollection( "rooms" )) );
	for (Room r : rooms) {
		if (r.type == Type.WEAK_FLOOR) {
			weakFloorCreated = true;
			break;
		}
		if (r.type == Type.ENTRANCE){
			roomEntrance = r;
		} else if (r.type == Type.EXIT || r.type == Type.BOSS_EXIT){
			roomExit = r;
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:19,代码来源:RegularLevel.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,代码来源:DragonCaveLevel.java

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

示例4: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	
	super.restoreFromBundle( bundle );
	
	pos = bundle.getInt( POS );
	HP = bundle.getInt( TAG_HP );
	HT = bundle.getInt( TAG_HT );
	SHLD = bundle.getInt( TAG_SHLD );
	
	for (Bundlable b : bundle.getCollection( BUFFS )) {
		if (b != null) {
			((Buff)b).attachTo( this );
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:17,代码来源:Char.java

示例5: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	items = new ArrayList<Item>(
			(Collection<Item>) ((Collection<?>) bundle.getCollection(ITEMS)));
	adjustStats(bundle.getInt(LEVEL));
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:MonsterBox.java

示例6: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	
	rooms = new HashSet(bundle.getCollection( "rooms" ) );
	for (Room r : rooms) {
		if (r.type == Type.WEAK_FLOOR) {
			weakFloorCreated = true;
			break;
		}
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:14,代码来源:RegularLevel.java

示例7: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle( Bundle bundle ) {
	pos = bundle.getInt( POS );
	type = Type.valueOf( bundle.getString( TYPE ) );
	items = new LinkedList( bundle.getCollection( ITEMS ) );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:8,代码来源:Heap.java

示例8: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle( Bundle bundle ) {
	pos = bundle.getInt( POS );
	seen = bundle.getBoolean( SEEN );
	type = Type.valueOf( bundle.getString( TYPE ) );
	items = new LinkedList<Item>( (Collection<Item>) ((Collection<?>) bundle.getCollection( ITEMS )) );
	items.removeAll(Collections.singleton(null));
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:10,代码来源:Heap.java

示例9: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	for (Bundlable item : bundle.getCollection( ITEMS )) {
		((Item)item).collect( this );
	};
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:8,代码来源:Bag.java

示例10: restorePlaceholders

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public void restorePlaceholders(Bundle bundle) {
	Collection<Bundlable> placeholders = bundle.getCollection(PLACEHOLDERS);
	boolean[] placements = bundle.getBooleanArray(PLACEMENTS);

	int i = 0;
	for (Bundlable item : placeholders) {
		while (!placements[i])
			i++;
		setSlot(i, (Item) item);
		i++;
	}

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

示例11: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	items = new ArrayList(bundle.getCollection( ITEMS ) );
	adjustStats( bundle.getInt( LEVEL ) );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:8,代码来源:Mimic.java

示例12: 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:G2159687,项目名称:ESPD,代码行数:9,代码来源:Bag.java

示例13: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle( Bundle bundle ) {
	items = new ArrayList<>( (Collection<Item>) ((Collection<?>) bundle.getCollection( ITEMS ) ));
	adjustStats( bundle.getInt( LEVEL ) );
	super.restoreFromBundle(bundle);
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:8,代码来源:Mimic.java

示例14: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
	
	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 );
	
	weakFloorCreated = false;
	
	adjustMapSize();
	
	Collection<Bundlable> collection = bundle.getCollection( HEAPS );
	for (Bundlable h : collection) {
		Heap heap = (Heap)h;
		if (resizingNeeded) {
			heap.pos = adjustPos( heap.pos );
		}
		heaps.put( heap.pos, heap );
	}
	
	collection = bundle.getCollection( PLANTS );
	for (Bundlable p : collection) {
		Plant plant = (Plant)p;
		if (resizingNeeded) {
			plant.pos = adjustPos( plant.pos );
		}
		plants.put( plant.pos, plant );
	}
	
	collection = bundle.getCollection( MOBS );
	for (Bundlable m : collection) {
		Mob mob = (Mob)m;
		if (mob != null) {
			if (resizingNeeded) {
				mob.pos = adjustPos( mob.pos );
			}
			mobs.add( mob );
		}
	}
	
	collection = bundle.getCollection( BLOBS );
	for (Bundlable b : collection) {
		Blob blob = (Blob)b;
		blobs.put( blob.getClass(), blob );
	}
	
	buildFlagMaps();
	cleanWalls();
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:58,代码来源:Level.java

示例15: restoreFromBundle

import com.watabou.utils.Bundle; //导入方法依赖的package包/类
public static void restoreFromBundle( Bundle bundle ) {
	records = new ArrayList<Record>();
	for (Bundlable rec : bundle.getCollection( JOURNAL ) ) {
		records.add( (Record) rec );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:7,代码来源:Journal.java


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