本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon.activate方法的典型用法代码示例。如果您正苦于以下问题:Java KindOfWeapon.activate方法的具体用法?Java KindOfWeapon.activate怎么用?Java KindOfWeapon.activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon
的用法示例。
在下文中一共展示了KindOfWeapon.activate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreFromBundle
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; //导入方法依赖的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 );
misc1 = (KindofMisc)bundle.get(MISC1);
if (misc1 != null) {
misc1.activate( owner );
}
misc2 = (KindofMisc)bundle.get(MISC2);
if (misc2 != null) {
misc2.activate( owner );
}
}
示例2: restoreFromBundle
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; //导入方法依赖的package包/类
public void restoreFromBundle( Bundle bundle ) {
//moving keys to Notes, for pre-0.6.1 saves
if (bundle.contains("ironKeys")) {
int[] ironKeys = bundle.getIntArray( "ironKeys" );
for (int i = 0; i < ironKeys.length; i++){
if (ironKeys[i] > 0){
Notes.add((Key) new IronKey(i).quantity(ironKeys[i]));
}
}
}
if (bundle.contains("specialKeys")) {
int[] specialKeys = bundle.getIntArray( "specialKeys" );
for (int i = 0; i < specialKeys.length; i++){
if (specialKeys[i] > 0){
if (i % 5 == 0){
Notes.add((Key) new SkeletonKey(i).quantity(specialKeys[i]));
} else {
Notes.add((Key) new GoldenKey(i).quantity(specialKeys[i]));
}
}
}
}
backpack.clear();
backpack.restoreFromBundle( bundle );
weapon = (KindOfWeapon) bundle.get(WEAPON);
if (weapon != null) {
weapon.activate(owner);
}
armor = (Armor)bundle.get( ARMOR );
if (armor != null){
armor.activate( owner );
}
misc1 = (KindofMisc)bundle.get(MISC1);
if (misc1 != null) {
misc1.activate( owner );
}
misc2 = (KindofMisc)bundle.get(MISC2);
if (misc2 != null) {
misc2.activate( owner );
}
}