/*
 * 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.normal.WorkArea;
import de.steamwar.bausystem.region.dynamic.normal.WorkRegion;
import lombok.Getter;
import lombok.NonNull;
import org.bukkit.Bukkit;

import java.io.File;

public class WarGear21WorkRegion extends WorkRegion {

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

    private static final File MODE_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/regions/wargear21/");
    private static final File REGION_FILE = new File(MODE_DIR, "Region.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 WarGear21WorkRegion(int minX, int minZ) {
        super(minX, minZ);
        area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
        northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this);
        southArea = new WorkArea(minX + 33, 32, minZ + 139, 67, 41, 47, null, true, this);
        frame = FRAME_FILE;
        testblock = TESTBLOCK_FILE;
    }

    public WarGear21WorkRegion(RegionConstructorData regionConstructorData) {
        super(regionConstructorData);
        area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this);
        northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this);
        southArea = new WorkArea(minX + 33, 32, minZ + 139, 67, 41, 47, null, true, this);
        frame = FRAME_FILE;
        testblock = TESTBLOCK_FILE;
    }

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