From 7227e4cb49d713a31deadf55f3c110972432f518 Mon Sep 17 00:00:00 2001 From: Arnav495 Date: Tue, 10 Mar 2026 15:35:34 -0700 Subject: [PATCH] Make Zone a record. --- src/main/java/frc/robot/util/Zone.java | 35 +++++++++++--------------- 1 file changed, 14 insertions(+), 21 deletions(-) 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; + } } -- 2.39.5