本文整理匯總了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 ) );
}