本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoMob类的典型用法代码示例。如果您正苦于以下问题:Java WndInfoMob类的具体用法?Java WndInfoMob怎么用?Java WndInfoMob使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WndInfoMob类属于com.shatteredpixel.shatteredpixeldungeon.windows包,在下文中一共展示了WndInfoMob类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: examineObject
import com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoMob; //导入依赖的package包/类
public static void examineObject(Object o){
if (o == Dungeon.hero){
GameScene.show( new WndHero() );
} else if ( o instanceof Mob ){
GameScene.show(new WndInfoMob((Mob) o));
} else if ( o instanceof Heap ){
Heap heap = (Heap)o;
if (heap.type == Heap.Type.FOR_SALE && heap.size() == 1 && heap.peek().price() > 0) {
GameScene.show(new WndTradeItem(heap, false));
} else {
GameScene.show(new WndInfoItem(heap));
}
} else if ( o instanceof Plant ){
GameScene.show( new WndInfoPlant((Plant) o) );
} else if ( o instanceof Trap ){
GameScene.show( new WndInfoTrap((Trap) o));
} else {
GameScene.show( new WndMessage( Messages.get(GameScene.class, "dont_know") ) ) ;
}
}
示例2: onSelect
import com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoMob; //导入依赖的package包/类
@Override
public void onSelect( Integer cell ) {
if (cell == null) {
return;
}
if (cell < 0 || cell > Level.LENGTH || (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell])) {
GameScene.show( new WndMessage( "You don't know what is there." ) ) ;
return;
}
if (!Dungeon.visible[cell]) {
GameScene.show( new WndInfoCell( cell ) );
return;
}
if (cell == Dungeon.hero.pos) {
GameScene.show( new WndHero() );
return;
}
Mob mob = (Mob)Actor.findChar( cell );
if (mob != null) {
GameScene.show( new WndInfoMob( mob ) );
return;
}
Heap heap = Dungeon.level.heaps.get( cell );
if (heap != null) {
if (heap.type == Heap.Type.FOR_SALE && heap.size() == 1 && heap.peek().price() > 0) {
GameScene.show( new WndTradeItem( heap, false ) );
} else {
GameScene.show( new WndInfoItem( heap ) );
}
return;
}
Plant plant = Dungeon.level.plants.get( cell );
if (plant != null) {
GameScene.show( new WndInfoPlant( plant ) );
return;
}
GameScene.show( new WndInfoCell( cell ) );
}