Cleanup GameBOardService

This commit is contained in:
2025-12-17 06:34:57 +08:00
parent b3dc2cb4bd
commit 2de9359dda
6 changed files with 91 additions and 79 deletions

View File

@@ -14,5 +14,10 @@ namespace Utils {
public static Vector2Int ToVector2Int(this Vector2 v) {
return new Vector2Int((int)v.x, (int)v.y);
}
public static bool IsAdjacent(this Vector2Int a, Vector2Int b) {
Vector2Int d = b - a;
return (Mathf.Abs(d.x) == 1 && d.y == 0) || (Mathf.Abs(d.y) == 1 && d.x == 0);
}
}
}