001/*
002 * PlotSquared, a land and world management plugin for Minecraft.
003 * Copyright (C) IntellectualSites <https://intellectualsites.com>
004 * Copyright (C) IntellectualSites team and contributors
005 *
006 * This program is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
018 */
019package com.plotsquared.core.services.plots;
020
021import com.plotsquared.core.player.PlotPlayer;
022import com.plotsquared.core.plot.PlotArea;
023import com.plotsquared.core.plot.PlotId;
024import org.checkerframework.checker.nullness.qual.NonNull;
025import org.checkerframework.checker.nullness.qual.Nullable;
026
027/**
028 * Crate a new auto query
029 *
030 * @param player   Player to claim for
031 * @param startId  Plot ID to start searching from
032 * @param sizeX    Number of plots along the X axis
033 * @param sizeZ    Number of plots along the Z axis
034 * @param plotArea Plot area to search in
035 */
036public record AutoQuery(
037        @NonNull PlotPlayer<?> player,
038        @Nullable PlotId startId,
039        int sizeX,
040        int sizeZ,
041        @NonNull PlotArea plotArea
042) {
043
044    /**
045     * Get the player that the plots are meant for
046     *
047     * @return Player
048     */
049    @Override
050    public @NonNull PlotPlayer<?> player() {
051        return this.player;
052    }
053
054    /**
055     * Get the plot ID to start searching from
056     *
057     * @return Start ID
058     */
059    @Override
060    public @Nullable PlotId startId() {
061        return this.startId;
062    }
063
064    /**
065     * Get the number of plots along the X axis
066     *
067     * @return Number of plots along the X axis
068     */
069    @Override
070    public int sizeX() {
071        return this.sizeX;
072    }
073
074    /**
075     * Get the number of plots along the Z axis
076     *
077     * @return Number of plots along the Z axis
078     */
079    @Override
080    public int sizeZ() {
081        return this.sizeZ;
082    }
083
084    /**
085     * Get the plot area to search in
086     *
087     * @return Plot area
088     */
089    @Override
090    public @NonNull PlotArea plotArea() {
091        return this.plotArea;
092    }
093
094}