當前位置: 首頁>>代碼示例>>Java>>正文


Java WndInfoMob類代碼示例

本文整理匯總了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") ) ) ;
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:21,代碼來源:GameScene.java

示例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 ) );
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:47,代碼來源:Toolbar.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoMob類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。