forked from SteamWar/SteamWar
86 lines
2.5 KiB
Java
86 lines
2.5 KiB
Java
/*
|
|
* This file is a part of the SteamWar software.
|
|
*
|
|
* Copyright (C) 2024 SteamWar.de-Serverteam
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package de.steamwar.bausystem.regionnew;
|
|
|
|
import com.sk89q.worldedit.EditSession;
|
|
import de.steamwar.bausystem.regionnew.flags.Flag;
|
|
import de.steamwar.sql.SchematicNode;
|
|
import lombok.NonNull;
|
|
import org.bukkit.Location;
|
|
|
|
import javax.annotation.Nullable;
|
|
import java.io.File;
|
|
import java.util.Optional;
|
|
|
|
public interface Region {
|
|
|
|
static Region getRegion(Location location) {
|
|
return RegionSystem.REGION_SYSTEM.get(location);
|
|
}
|
|
|
|
RegionType getType();
|
|
|
|
<T extends Enum<T> & Flag.Value<T>> RegionFlagPolicy hasFlag(@NonNull Flag<T> flag);
|
|
|
|
<T extends Enum<T> & Flag.Value<T>> boolean setFlag(@NonNull Flag<T> flag, Flag.Value<T> value);
|
|
|
|
<T extends Enum<T> & Flag.Value<T>> Optional<Flag.Value<T>> getFlag(@NonNull Flag<T> flag);
|
|
|
|
Point getMinPoint();
|
|
|
|
Point getMaxPoint();
|
|
|
|
boolean inRegion(Location location);
|
|
|
|
Optional<Point> getBuildMinPoint(boolean extension);
|
|
|
|
Optional<Point> getBuildMaxPoint(boolean extension);
|
|
|
|
boolean inBuildRegion(Location location, boolean extension);
|
|
|
|
Optional<Point> getTestblockMinPoint(boolean extension);
|
|
|
|
Optional<Point> getTestblockMaxPoint(boolean extension);
|
|
|
|
boolean inTestblockRegion(Location location, boolean extension);
|
|
|
|
// TODO: Add forEachChunk and getChunkOutsidePredicate
|
|
|
|
Optional<File> getGameModeConfig();
|
|
|
|
Optional<EditSession> copy();
|
|
|
|
Optional<EditSession> copyBuild();
|
|
|
|
Optional<EditSession> copyTestblock();
|
|
|
|
void reset();
|
|
|
|
void resetBuild(@Nullable SchematicNode schematicNode, boolean extension);
|
|
|
|
void resetTestblock(@Nullable SchematicNode schematicNode, boolean extension);
|
|
|
|
void remember(EditSession editSession);
|
|
|
|
boolean undo();
|
|
|
|
boolean redo();
|
|
}
|