本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.utils.BArray.or方法的典型用法代码示例。如果您正苦于以下问题:Java BArray.or方法的具体用法?Java BArray.or怎么用?Java BArray.or使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.utils.BArray
的用法示例。
在下文中一共展示了BArray.or方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findPath
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; //导入方法依赖的package包/类
public static int findPath( Char ch, int from, int to, boolean pass[], boolean[] visible ) {
if (Level.adjacent( from, to )) {
return Actor.findChar( to ) == null && (pass[to] || Level.avoid[to]) ? to : -1;
}
if (ch.flying || ch.buff( Amok.class ) != null) {
BArray.or( pass, Level.avoid, passable );
} else {
System.arraycopy( pass, 0, passable, 0, Level.LENGTH );
}
for (Actor actor : Actor.all()) {
if (actor instanceof Char) {
int pos = ((Char)actor).pos;
if (visible[pos]) {
passable[pos] = false;
}
}
}
return PathFinder.getStep( from, to, passable );
}
示例2: flee
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; //导入方法依赖的package包/类
public static int flee( Char ch, int cur, int from, boolean pass[], boolean[] visible ) {
if (ch.flying) {
BArray.or( pass, Level.avoid, passable );
} else {
System.arraycopy( pass, 0, passable, 0, Level.LENGTH );
}
for (Actor actor : Actor.all()) {
if (actor instanceof Char) {
int pos = ((Char)actor).pos;
if (visible[pos]) {
passable[pos] = false;
}
}
}
passable[cur] = true;
return PathFinder.getStepBack( cur, from, passable );
}
示例3: findPath
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; //导入方法依赖的package包/类
public static PathFinder.Path findPath(Char ch, int from, int to, boolean pass[], boolean[] visible ) {
setupPassable();
if (ch.flying || ch.buff( Amok.class ) != null) {
BArray.or( pass, Dungeon.level.avoid, passable );
} else {
System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() );
}
for (Char c : Actor.chars()) {
if (visible[c.pos]) {
passable[c.pos] = false;
}
}
return PathFinder.find( from, to, passable );
}
示例4: findStep
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; //导入方法依赖的package包/类
public static int findStep(Char ch, int from, int to, boolean pass[], boolean[] visible ) {
if (Dungeon.level.adjacent( from, to )) {
return Actor.findChar( to ) == null && (pass[to] || Dungeon.level.avoid[to]) ? to : -1;
}
setupPassable();
if (ch.flying || ch.buff( Amok.class ) != null) {
BArray.or( pass, Dungeon.level.avoid, passable );
} else {
System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() );
}
for (Char c : Actor.chars()) {
if (visible[c.pos]) {
passable[c.pos] = false;
}
}
return PathFinder.getStep( from, to, passable );
}
示例5: flee
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; //导入方法依赖的package包/类
public static int flee( Char ch, int cur, int from, boolean pass[], boolean[] visible ) {
setupPassable();
if (ch.flying) {
BArray.or( pass, Dungeon.level.avoid, passable );
} else {
System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() );
}
for (Char c : Actor.chars()) {
if (visible[c.pos]) {
passable[c.pos] = false;
}
}
passable[cur] = true;
return PathFinder.getStepBack( cur, from, passable );
}
示例6: onZap
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; //导入方法依赖的package包/类
@Override
protected void onZap( int cell ) {
int level = level();
int n = level + 2;
if (Actor.findChar( cell ) != null && Ballistica.distance > 2) {
cell = Ballistica.trace[Ballistica.distance - 2];
}
boolean[] passable = BArray.or( Level.passable, Level.avoid, null );
for (Actor actor : Actor.all()) {
if (actor instanceof Char) {
passable[((Char)actor).pos] = false;
}
}
PathFinder.buildDistanceMap( cell, passable, n );
int dist = 0;
if (Actor.findChar( cell ) != null) {
PathFinder.distance[cell] = Integer.MAX_VALUE;
dist = 1;
}
float lifespan = level + 3;
sheepLabel:
for (int i=0; i < n; i++) {
do {
for (int j=0; j < Level.LENGTH; j++) {
if (PathFinder.distance[j] == dist) {
Sheep sheep = new Sheep();
sheep.lifespan = lifespan;
sheep.pos = j;
GameScene.add( sheep );
Dungeon.level.mobPress( sheep );
CellEmitter.get( j ).burst( Speck.factory( Speck.WOOL ), 4 );
PathFinder.distance[j] = Integer.MAX_VALUE;
continue sheepLabel;
}
}
dist++;
} while (dist < n);
}
}
示例7: observe
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; //导入方法依赖的package包/类
public static void observe() {
if (level == null) {
return;
}
level.updateFieldOfView( hero );
System.arraycopy( Level.fieldOfView, 0, visible, 0, visible.length );
BArray.or( level.visited, visible, level.visited );
GameScene.afterObserve();
}