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