• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java WndTradeItem类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.watabou.pixeldungeon.windows.WndTradeItem的典型用法代码示例。如果您正苦于以下问题:Java WndTradeItem类的具体用法?Java WndTradeItem怎么用?Java WndTradeItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

WndTradeItem类属于com.watabou.pixeldungeon.windows包,在下文中一共展示了WndTradeItem类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: actBuy

点赞 3

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的package包/类
private boolean actBuy( HeroAction.Buy action ) {
	int dst = action.dst;
	if (pos == dst || Level.adjacent( pos, dst )) {

		ready();
		
		Heap heap = Dungeon.level.heaps.get( dst );
		if (heap != null && heap.type == Type.FOR_SALE && heap.size() == 1) {
			GameScene.show( new WndTradeItem( heap, true ) );
		}
		
		return false;
		
	} else if (getCloser( dst )) {
		
		return true;
		
	} else {
		ready();
		return false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:23,
代码来源:Hero.java

示例2: actBuy

点赞 3

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的package包/类
private boolean actBuy(HeroAction.Buy action) {
	int dst = action.dst;
	if (getPos() == dst || Dungeon.level.adjacent(getPos(), dst)) {

		ready();

		Heap heap = Dungeon.level.getHeap(dst);
		if (heap != null && heap.type == Type.FOR_SALE && heap.size() == 1) {
			GameScene.show(new WndTradeItem(heap, true));
		}

		return false;

	} else if (getCloser(dst)) {

		return true;

	} else {
		ready();
		return false;
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:23,
代码来源:Hero.java

示例3: onSelect

点赞 2

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的package包/类
@Override
public void onSelect( Item item ) {
	if (item != null) {
		WndBag parentWnd = sell();
		GameScene.show( new WndTradeItem( item, parentWnd ) );
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:8,
代码来源:Shopkeeper.java

示例4: onSelect

点赞 2

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的package包/类
@Override
public void onSelect(Item item) {
	if (item != null) {
		WndBag parentWnd = sell();
		GameScene.show(new WndTradeItem(item, parentWnd));
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:8,
代码来源:ScarecrowNPC.java

示例5: onSelect

点赞 2

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的package包/类
@Override
public void onSelect( Item item ) {
	if (item != null) {

		if(item instanceof Bag && !((Bag)item).items.isEmpty()) {
			GameScene.selectItemFromBag( itemSelector, (Bag)item , WndBag.Mode.FOR_SALE, Game.getVar(R.string.Shopkeeper_Sell));
			return;
		}

		WndBag parentWnd = sell();
		GameScene.show( new WndTradeItem( item, parentWnd ) );
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:14,
代码来源:Shopkeeper.java

示例6: onSelect

点赞 2

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的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 && heap.type != Heap.Type.HIDDEN) {
		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:kurtyu,
项目名称:PixelDungeonTC,
代码行数:47,
代码来源:Toolbar.java

示例7: onSelect

点赞 2

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的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:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:47,
代码来源:Toolbar.java

示例8: onSelect

点赞 2

import com.watabou.pixeldungeon.windows.WndTradeItem; //导入依赖的package包/类
@Override
public void onSelect(Integer cell) {

	if (cell == null) {
		return;
	}

	if (cell < 0
			|| cell > Dungeon.level.getLength()
			|| (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell])) {
		GameScene.show(new WndMessage(Game
				.getVar(R.string.Toolbar_Info1)));
		return;
	}

	if (!Dungeon.visible[cell]) {
		GameScene.show(new WndInfoCell(cell));
		return;
	}

	if (cell == Dungeon.hero.getPos()) {
		GameScene.show(new WndHero());
		return;
	}

	Mob mob = (Mob) Actor.findChar(cell);
	if (mob != null) {
		GameScene.show(new WndInfoMob(mob));
		return;
	}

	Heap heap = Dungeon.level.getHeap(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:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:51,
代码来源:Toolbar.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)