From: Arnav495 Date: Tue, 10 Mar 2026 22:35:34 +0000 (-0700) Subject: Make Zone a record. X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=7227e4cb49d713a31deadf55f3c110972432f518;p=FRC2026.git Make Zone a record. --- diff --git a/src/main/java/frc/robot/util/Zone.java b/src/main/java/frc/robot/util/Zone.java index 83f3447..f2fdbfb 100644 --- a/src/main/java/frc/robot/util/Zone.java +++ b/src/main/java/frc/robot/util/Zone.java @@ -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; + } }