本文整理汇总了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;
}
}
}
示例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);
}
}
}
示例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;
}
}
}
}
示例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 );
}
}
}
示例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));
}
示例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;
}
}
}
示例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 ) );
}
示例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));
}
示例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 );
};
}
示例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++;
}
}
示例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 ) );
}
示例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);
}
}
示例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);
}
示例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();
}
示例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 );
}
}