/*
 * 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.work;

import de.steamwar.bausystem.region.GameModeConfig;
import de.steamwar.bausystem.region.RegionType;
import de.steamwar.bausystem.region.dynamic.RegionConstructorData;
import de.steamwar.bausystem.region.dynamic.VariantSelector;
import de.steamwar.bausystem.region.dynamic.normal.NormalArea;
import de.steamwar.bausystem.region.dynamic.normal.WorkRegion;
import lombok.Getter;
import lombok.NonNull;
import org.bukkit.Bukkit;

import java.io.File;

public class WarShip21WorkRegion extends WorkRegion {

    public static final int widthX = 285;
    public static final int widthZ = 228;

    private static final File MODE_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/regions/warship21/");
    private static final File REGION_FILE = new File(MODE_DIR, "Work.schem");
    private static final File FRAME_FILE = new File(MODE_DIR, "Frame.schem");
    private static final File TESTBLOCK_FILE = new File(MODE_DIR, "Testblock.schem");

    @Getter
    private final GameModeConfig gameModeConfig = new GameModeConfig(null); // TODO: Implement

    public WarShip21WorkRegion(int minX, int minZ) {
        super(minX, minZ);
        area = new NormalArea(minX, 0, minZ, widthX, 255, widthZ, VariantSelector.File(REGION_FILE), false, this);
        northArea = new NormalArea(minX + 28, 19, minZ + 25, 230, 58, 43, null, false, this);
        southArea = new NormalArea(minX + 28, 19, minZ + 160, 230, 58, 43, null, true, this);
        frame = VariantSelector.File(FRAME_FILE);
        testblock = VariantSelector.File(TESTBLOCK_FILE);
    }

    public WarShip21WorkRegion(RegionConstructorData regionConstructorData) {
        super(regionConstructorData);
        area = new NormalArea(minX, 0, minZ, widthX, 255, widthZ, VariantSelector.File(REGION_FILE), false, this);
        northArea = new NormalArea(minX + 28, 19, minZ + 25, 230, 58, 43, null, false, this);
        southArea = new NormalArea(minX + 28, 19, minZ + 160, 230, 58, 43, null, true, this);
        frame = VariantSelector.File(FRAME_FILE);
        testblock = VariantSelector.File(TESTBLOCK_FILE);
    }

    @Override
    public @NonNull RegionType getType() {
        return RegionType.WET;
    }
}
