本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel類的典型用法代碼示例。如果您正苦於以下問題:Java LastShopLevel類的具體用法?Java LastShopLevel怎麽用?Java LastShopLevel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LastShopLevel類屬於com.shatteredpixel.shatteredpixeldungeon.levels包,在下文中一共展示了LastShopLevel類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: placeShopkeeper
import com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel; //導入依賴的package包/類
private static void placeShopkeeper( Level level, Room room ) {
int pos;
do {
pos = room.random();
} while (level.heaps.get( pos ) != null);
Mob shopkeeper = level instanceof LastShopLevel ? new ImpShopkeeper() : new Shopkeeper();
shopkeeper.pos = pos;
level.mobs.add( shopkeeper );
if (level instanceof LastShopLevel) {
for (int i=0; i < Level.NEIGHBOURS9.length; i++) {
int p = shopkeeper.pos + Level.NEIGHBOURS9[i];
if (level.map[p] == Terrain.EMPTY_SP) {
level.map[p] = Terrain.WATER;
}
}
}
}