]> git.taranathan.com Git - FRC2026.git/commitdiff
Make Zone a record.
authorArnav495 <arnieincyberland@gmail.com>
Tue, 10 Mar 2026 22:35:34 +0000 (15:35 -0700)
committerArnav495 <arnieincyberland@gmail.com>
Tue, 10 Mar 2026 22:35:34 +0000 (15:35 -0700)
src/main/java/frc/robot/util/Zone.java

index 83f34472b2be298859a81ac3acb9a41555ebf77a..f2fdbfb33f79b3ced5eec2d77ed746b37d265681 100644 (file)
@@ -1,25 +1,18 @@
 package frc.robot.util;
 
-public class Zone {
-    public double x_center;
-    public double y_center;
-    public double width;
-    public double length;
+public record Zone(
+               double x_center,
+               double y_center,
+               double width,
+               double length) {
 
-    public Zone(double x_center, double y_center, double width, double length) {
-        this.x_center = x_center;
-        this.y_center = y_center;
-        this.width = width;
-        this.length = length;
-    }
-
-    public boolean isInside(double x, double y) {
-        if (x > x_center + (length / 2) || x < x_center - (length / 2)) {
-            return false;
-        }
-        if (y > y_center + (width / 2) || y < y_center - (width / 2)) {
-            return false;
-        }
-        return true;
-    }
+       public boolean isInside(double x, double y) {
+               if (x > x_center + (length / 2) || x < x_center - (length / 2)) {
+                       return false;
+               }
+               if (y > y_center + (width / 2) || y < y_center - (width / 2)) {
+                       return false;
+               }
+               return true;
+       }
 }