本文整理汇总了Java中com.watabou.utils.Bundle.getEnum方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getEnum方法的具体用法?Java Bundle.getEnum怎么用?Java Bundle.getEnum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.utils.Bundle
的用法示例。
在下文中一共展示了Bundle.getEnum方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle(bundle);
state = bundle.getEnum( STATE, State.class );
//in some states tengu won't be in the world, in others he will be.
if (state == State.START || state == State.MAZE) {
tengu = (Tengu)bundle.get( TENGU );
} else {
for (Mob mob : mobs){
if (mob instanceof Tengu) {
tengu = (Tengu) mob;
break;
}
}
}
for (Bundlable item : bundle.getCollection(STORED_ITEMS)){
storedItems.add( (Item)item );
}
}
示例2: 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.DUST : Type.BERRY;
}
given = node.getBoolean( GIVEN );
wand1 = (Wand)node.get( WAND1 );
wand2 = (Wand)node.get( WAND2 );
} else {
reset();
}
}
示例3: 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();
}
}
示例4: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
if ((hitsToKnow = bundle.getInt(UNFAMILIRIARITY)) == 0) {
hitsToKnow = HITS_TO_KNOW;
}
enchantment = (Enchantment) bundle.get(ENCHANTMENT);
imbue = bundle.getEnum(IMBUE, Imbue.class);
}
示例5: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
state = bundle.getEnum(STATE, State.class);
if (state == State.EXHAUSTED) exhaustion = bundle.getInt(EXHAUSTION);
if (state == State.EXHAUSTED || state == State.RECOVERING) levelRecovery = bundle.getFloat(LEVEL_RECOVERY);
}
示例6: restoreFromBundle
import com.watabou.utils.Bundle; //导入方法依赖的package包/类
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
if ((hitsToKnow = bundle.getInt( UNFAMILIRIARITY )) == 0) {
hitsToKnow = HITS_TO_KNOW;
}
enchantment = (Enchantment)bundle.get( ENCHANTMENT );
imbue = bundle.getEnum( IMBUE, Imbue.class );
}
示例7: 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();
}