/*
* 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 .
*/
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();
& Flag.Value> RegionFlagPolicy hasFlag(@NonNull Flag flag);
& Flag.Value> boolean setFlag(@NonNull Flag flag, Flag.Value value);
& Flag.Value> Optional> getFlag(@NonNull Flag flag);
Point getMinPoint();
Point getMaxPoint();
boolean inRegion(Location location);
Optional getBuildMinPoint(boolean extension);
Optional getBuildMaxPoint(boolean extension);
boolean inBuildRegion(Location location, boolean extension);
Optional getTestblockMinPoint(boolean extension);
Optional getTestblockMaxPoint(boolean extension);
boolean inTestblockRegion(Location location, boolean extension);
// TODO: Add forEachChunk and getChunkOutsidePredicate
Optional getGameModeConfig();
Optional copy();
Optional copyBuild();
Optional 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();
}