第十一次实验课代码

添加C08~C011
This commit is contained in:
2025-11-20 17:01:56 +08:00
parent 1c869f816f
commit 9930f2421a
67 changed files with 1137 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
package game;
import java.awt.*;
public enum Direction {
UP(new Point(0,-1)),
DOWN(new Point(0,1)),
LEFT(new Point(-1,0)),
RIGHT(new Point(1,0));
private Point offset;
Direction(Point offset) {
this.offset = offset;
}
public static Point getOffset(Direction dir) {
return dir.offset;
}
}