/*
 * This file is a part of the SteamWar software.
 *
 * Copyright (C) 2020  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.region.dynamic.normal;

import com.sk89q.worldedit.extent.clipboard.Clipboard;
import de.steamwar.bausystem.region.Point;
import de.steamwar.bausystem.region.Region;
import de.steamwar.bausystem.utils.PasteBuilder;
import org.bukkit.Location;

import java.io.File;
import java.util.function.BiConsumer;

public abstract class NormalArea implements Region.Area {

    public abstract NormalArea setResetFile(File resetFile);

    public static final NormalArea EMPTY = new NormalArea() {
        @Override
        public boolean isEmpty() {
            return true;
        }

        @Override
        public Point getMinPoint(boolean extension) {
            return Point.ZERO;
        }

        @Override
        public Point getMaxPoint(boolean extension) {
            return Point.ZERO;
        }

        @Override
        public Point getCopyPoint() {
            return Point.ZERO;
        }

        @Override
        public boolean inRegion(Location location, boolean extension) {
            return false;
        }

        @Override
        public Clipboard copy(boolean extension) {
            return null;
        }

        @Override
        public NormalArea setResetFile(File resetFile) {
            return this;
        }

        @Override
        public File getResetFile() {
            return null;
        }

        @Override
        public void reset(PasteBuilder pasteBuilder, boolean extension) {
        }

        @Override
        public void forEachChunk(BiConsumer<Integer, Integer> executor) {
        }

        @Override
        public boolean isChunkOutside(int chunkX, int chunkZ) {
            return false;
        }
    };
}
