本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon.reportException方法的典型用法代码示例。如果您正苦于以下问题:Java ShatteredPixelDungeon.reportException方法的具体用法?Java ShatteredPixelDungeon.reportException怎么用?Java ShatteredPixelDungeon.reportException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon
的用法示例。
在下文中一共展示了ShatteredPixelDungeon.reportException方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: seed
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static<T extends Blob> T seed( int cell, int amount, Class<T> type ) {
try {
T gas = (T)Dungeon.level.blobs.get( type );
if (gas == null) {
gas = type.newInstance();
Dungeon.level.blobs.put( type, gas );
}
gas.seed( cell, amount );
return gas;
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例2: random
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public static Item random( Category cat ) {
try {
switch (cat) {
case ARMOR:
return randomArmor();
case WEAPON:
return randomWeapon();
case ARTIFACT:
Item item = randomArtifact();
//if we're out of artifacts, return a ring instead.
return item != null ? item : random(Category.RING);
default:
return ((Item)cat.classes[Random.chances( cat.probs )].newInstance()).random();
}
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例3: updateImage
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
private synchronized void updateImage() {
if (sprite != null) {
sprite.killAndErase();
sprite = null;
}
try {
sprite = lastTarget.spriteClass.newInstance();
active = true;
sprite = ClassReflection.newInstance(lastTarget.spriteClass);
sprite.idle();
sprite.paused = true;
add( sprite );
sprite.x = x + (width - sprite.width()) / 2 + 1;
sprite.y = y + (height - sprite.height()) / 2;
PixelScene.align(sprite);
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
示例4: createRoom
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public static SecretRoom createRoom(){
SecretRoom r = null;
int index = runSecrets.size();
for (int i = 0; i < 4; i++){
int newidx = Random.Int( runSecrets.size() );
if (newidx < index) index = newidx;
}
try {
r = runSecrets.get( index ).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
runSecrets.add(runSecrets.remove(index));
return r;
}
示例5: paint
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public void paint( Level level, Room room ) {
try {
paint.invoke( null, level, room );
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
示例6: randomArtifact
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public static Artifact randomArtifact() {
try {
Category cat = Category.ARTIFACT;
int i = Random.chances( cat.probs );
//if no artifacts are left, return null
if (i == -1){
return null;
}
Class<?extends Artifact> art = (Class<? extends Artifact>) cat.classes[i];
if (removeArtifact(art)) {
Artifact artifact = art.newInstance();
artifact.random();
return artifact;
} else {
return null;
}
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例7: append
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public static<T extends Buff> T append( Char target, Class<T> buffClass ) {
try {
T buff = buffClass.newInstance();
buff.attachTo( target );
return buff;
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例8: virtual
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public static Item virtual( Class<? extends Item> cl ) {
try {
Item item = (Item)cl.newInstance();
item.quantity = 0;
return item;
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例9: onPause
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
public synchronized void onPause() {
try {
Dungeon.saveAll();
Badges.saveGlobal();
Journal.saveGlobal();
} catch (IOException e) {
ShatteredPixelDungeon.reportException(e);
}
}
示例10: randomArmor
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public static Armor randomArmor(int floorSet) {
floorSet = (int)GameMath.gate(0, floorSet, floorSetTierProbs.length-1);
try {
Armor a = (Armor)Category.ARMOR.classes[Random.chances(floorSetTierProbs[floorSet])].newInstance();
a.random();
return a;
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例11: random
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static Enchantment random() {
try {
return ((Class<Enchantment>)enchants[ Random.chances( chances ) ]).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例12: proc
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
try {
return Random.oneOf(randomEnchants).newInstance().proc( weapon, attacker, defender, damage );
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return damage;
}
}
示例13: showAmuletScene
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
private void showAmuletScene( boolean showText ) {
try {
Dungeon.saveAll();
AmuletScene.noText = !showText;
Game.switchScene( AmuletScene.class );
} catch (IOException e) {
ShatteredPixelDungeon.reportException(e);
}
}
示例14: virtual
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
public static Item virtual( Class<? extends Item> cl ) {
try {
Item item = (Item)ClassReflection.newInstance(cl);
item.quantity = 0;
return item;
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}
示例15: createMob
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; //导入方法依赖的package包/类
@Override
public Mob createMob() {
if (mobsToSpawn == null || mobsToSpawn.isEmpty())
mobsToSpawn = Bestiary.getMobRotation(Dungeon.depth);
try {
return mobsToSpawn.remove(0).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
return null;
}
}