/*
 *   This file is a part of the SteamWar software.
 *
 *   Copyright (C) 2025 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.features.simulator.data.redstone;

import de.steamwar.bausystem.features.simulator.data.Simulator;
import de.steamwar.bausystem.features.simulator.data.SimulatorBlockAlignedElement;
import de.steamwar.bausystem.features.simulator.data.SimulatorGroup;
import de.steamwar.bausystem.features.simulator.gui.SimulatorRedstoneGui;
import de.steamwar.bausystem.features.simulator.gui.base.SimulatorBaseGui;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;

public final class RedstoneElement extends SimulatorBlockAlignedElement<RedstonePhase> {

    public RedstoneElement(Vector position) {
        super(Material.REDSTONE_BLOCK, position);
    }

    @Override
    public String getName(Player player) {
        return "Redstone";
    }

    @Override
    public Material getWorldMaterial() {
        return Material.REDSTONE_BLOCK;
    }

    @Override
    public Material getWorldDisabledMaterial() {
        return Material.WHITE_STAINED_GLASS;
    }

    @Override
    public Vector getWorldPos() {
        return position.clone().add(new Vector(0.5, 0, 0.5));
    }

    @Override
    public void open(Player player, Simulator simulator, SimulatorGroup group, SimulatorBaseGui back) {
        new SimulatorRedstoneGui(player, simulator, group, this, back).open();
    }

    @Override
    public String getType() {
        return "Redstone";
    }
}
