package top.leisuretimedock.dglabgame.datagen.value;

import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Unmodifiable;
import top.leisuretimedock.dglabgame.DGLabGame;
import top.r3944realms.lib39.datagen.value.ILangKeyValue;
import top.r3944realms.lib39.datagen.value.ILangKeyValueCollection;
import top.r3944realms.lib39.datagen.value.LangKeyValue;
import top.r3944realms.lib39.datagen.value.ModPartEnum;

import java.util.ArrayList;
import java.util.List;

public enum DLGLangKey implements ILangKeyValueCollection {
    INSTANCE;
    /**
     * The Lang key values.
     */
    final List<LangKeyValue> langKeyValues = new ArrayList<>();

    DLGLangKey () {
        initLangKeyValues();
    }

    public void initLangKeyValues() {
        initKey();
    }
    private void initKey() {
        LangKeyValue mod = LangKeyValue.ofKey(DGLabGame.MOD_ID + ".name", ModPartEnum.DEFAULT,
                "DG Lab Game", "郊狼游戏", "郊狼游戲", "郊狼戯"
        );
        addLang(
                mod
        );
        addLang(
                LangKeyValue.copyOf("key.categories.dglabgame", ModPartEnum.NAME,
                    mod
                )
        );
        addLang(
                LangKeyValue.ofKey("key.dglabgame.test", ModPartEnum.NAME,
                        "Test", "测试", "测试", "式"
                )
        );
// 用户协议相关翻译
        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.refuse", ModPartEnum.NAME,
                        "§4§lRefuse",
                        "§4§l拒绝",
                        "§4§l拒絕",
                        "§4§l否"
                )
        );

        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.accept", ModPartEnum.NAME,
                        "§2§lAccept",
                        "§2§l接受",
                        "§2§l接受",
                        "§2§l認"
                )
        );

        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.line1", ModPartEnum.NAME,
                        "1. This mod is developed by §e§lR3944Realms §r, completely free and open source.",
                        "1. 本模组由 §e§lR3944Realms §r开发，完全免费开源。",
                        "1. 本模組由 §e§lR3944Realms §r 開發，完全免費開源。",
                        "1. 本模組乃 §e§lR3944Realms §r 所製，全然免費而開源。"
                )
        );

        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.line2", ModPartEnum.NAME,
                        "2. Only supports DG Lab 3.0 host (WebSocket protocol compatible)",
                        "2. 仅支持 DG Lab 3.0 主机（支持 WebSocket 协议）",
                        "2. 僅支援 DG Lab 3.0 主機（支援 WebSocket 協定）",
                        "2. 惟 DG Lab 3.0 主機可相容，WebSocket 協定亦得支援。"
                )
        );

        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.line3", ModPartEnum.NAME,
                        "3. §e§lWARNING:§4 Using electro-stimulation devices carries risks!",
                        "3. §e§l警告：§4使用释放电的设备存在风险！",
                        "3. §e§l警告：§4使用釋放電設備存在風險！",
                        "3. §e§l警之！§4釋電之器，用者有險！"
                )
        );

        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.line4", ModPartEnum.NAME,
                        "4. §4Users must be at least 18 years old and assume all risks of use.",
                        "4. §4使用者需年满 18 周岁，并自行承担所有使用风险。",
                        "4. §4使用者需年滿 18 歲，並自行承擔所有使用風險。",
                        "4. §4用者須年滿十八，自負其責。"
                )
        );

        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.line5", ModPartEnum.NAME,
                        "5. §4Prohibited for any illegal or immoral activities.",
                        "5. §4禁止用于任何违法或不道德的活动。",
                        "5. §4禁止用於任何違法或不道德之活動。",
                        "5. §4禁作非法不德之事。"
                )
        );

        addLang(
                LangKeyValue.ofKey("dglabgame.user_agreement.line6", ModPartEnum.NAME,
                        "6. §4Developers are not responsible for any personal injury or property damage.",
                        "6. §4开发者不对任何人身伤害或财产损失负责。",
                        "6. §4開發者不對任何人身份害或財產損失負責。",
                        "6. §4凡人身之傷、財物之損，開發者概不負責。"
                )
        );
        //dglabgame.user_agreement.refuse
        // Refuse
        // 拒绝
        //dglabgame.user_agreement.accept
        // accept
        // 同意
        //dglabgame.user_agreement.1 - 6
        // 1. 本模组由 R3944Realms 开发，完全免费开源。
        // 1. This mod is developed by R3944Realms, completely free and open source.
        //
        // 2. 仅支持 DG Lab 3.0 主机（支持 WebSocket 协议）
        // 2. Only supports DG Lab 3.0 host (WebSocket protocol compatible)
        //
        // 3. 警告：使用释放电的设备存在风险！
        // 3. WARNING: Using electro-stimulation devices carries risks!
        //
        // 4. 使用者需年满 18 周岁，并自行承担所有使用风险。
        // 4. Users must be at least 18 years old and assume all risks of use.
        //
        // 5. 禁止用于任何违法或不道德的活动。
        // 5. Prohibited for any illegal or immoral activities.
        //
        // 6. 开发者不对任何人身伤害或财产损失负责。
        // 6. Developers are not responsible for any personal injury or property damage.

    }
    @Contract(pure = true)
    @Override
    public @Unmodifiable List<? extends ILangKeyValue> getValues() {
        return List.copyOf(langKeyValues);
    }

    /**
     * Add lang.
     *
     * @param keyValue the key value
     */
    public void addLang(LangKeyValue keyValue) {
        langKeyValues.add(keyValue);
    }

    /**
     * Clear.
     */
    public void clear() {
        langKeyValues.clear();
    }
}
