本文整理汇总了Java中com.watabou.utils.Point.set方法的典型用法代码示例。如果您正苦于以下问题:Java Point.set方法的具体用法?Java Point.set怎么用?Java Point.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.utils.Point
的用法示例。
在下文中一共展示了Point.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawInside
import com.watabou.utils.Point; //导入方法依赖的package包/类
public static Point drawInside(Level level, Room room, Point from, int n,
int value) {
Point step = new Point();
if (from.x == room.left) {
step.set(+1, 0);
} else if (from.x == room.right) {
step.set(-1, 0);
} else if (from.y == room.top) {
step.set(0, +1);
} else if (from.y == room.bottom) {
step.set(0, -1);
}
Point p = new Point(from).offset(step);
for (int i = 0; i < n; i++) {
if (value != -1) {
set(level, p, value);
}
p.offset(step);
}
return p;
}
示例2: drawInside
import com.watabou.utils.Point; //导入方法依赖的package包/类
public static Point drawInside( Level level, Room room, Point from, int n, int value ) {
Point step = new Point();
if (from.x == room.left) {
step.set( +1, 0 );
} else if (from.x == room.right) {
step.set( -1, 0 );
} else if (from.y == room.top) {
step.set( 0, +1 );
} else if (from.y == room.bottom) {
step.set( 0, -1 );
}
Point p = new Point( from ).offset( step );
for (int i=0; i < n; i++) {
if (value != -1) {
set( level, p, value );
}
p.offset( step );
}
return p;
}
示例3: drawInside
import com.watabou.utils.Point; //导入方法依赖的package包/类
public static Point drawInside(Level level, Room room, Point from, int n, int value) {
Point step = new Point();
if (from.x == room.left) {
step.set(+1, 0);
} else if (from.x == room.right) {
step.set(-1, 0);
} else if (from.y == room.top) {
step.set(0, +1);
} else if (from.y == room.bottom) {
step.set(0, -1);
}
Point p = new Point(from).offset(step);
for (int i = 0; i < n; i++) {
if (value != -1) {
set(level, p, value);
}
p.offset(step);
}
return p;
}