// Path: src/main/java/net/technicpack/minecraftcore/launch/ILaunchOptions.java
// public interface ILaunchOptions {
//     String getClientId();
//     WindowType getLaunchWindowType();
//     int getCustomWidth();
//     int getCustomHeight();
//     boolean shouldUseStencilBuffer();
// }
// 
// Path: src/main/java/net/technicpack/minecraftcore/launch/WindowType.java
// public enum WindowType  {
//     DEFAULT,
//     FULLSCREEN,
//     CUSTOM
// }


import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import net.technicpack.minecraftcore.launch.ILaunchOptions;
import net.technicpack.minecraftcore.launch.WindowType;
import net.technicpack.utilslib.OperatingSystem;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
            String os = OperatingSystem.getOperatingSystem().getName();
            String osVersion = System.getProperty("os.version");
            String archProp = System.getProperty("os.arch").toLowerCase();
            return (name == null || name.equalsIgnoreCase(os))
                    && (version == null || version.matcher(osVersion).matches())
                    && (arch == null || archProp.contains(arch.toLowerCase()));
        }

        @Override
        public void serialize(JsonObject root) {
            JsonObject os = new JsonObject();
            if (name != null) os.addProperty("name", name);
            if (version != null) os.addProperty("version", version.pattern());
            if (arch != null) os.addProperty("arch", arch);
            root.add("os", os);
        }

    }

    private static class CustomResolutionCondition implements RuleCondition {

        private final boolean shouldHaveCustomResolution;

        CustomResolutionCondition(boolean shouldHaveCustomResolution) {
            this.shouldHaveCustomResolution = shouldHaveCustomResolution;
        }

        @Override
        public boolean test(ILaunchOptions opts) {
            return opts != null
// Path: src/main/java/net/technicpack/minecraftcore/launch/ILaunchOptions.java
// public interface ILaunchOptions {
//     String getClientId();
//     WindowType getLaunchWindowType();
//     int getCustomWidth();
//     int getCustomHeight();
//     boolean shouldUseStencilBuffer();
// }
// 
// Path: src/main/java/net/technicpack/minecraftcore/launch/WindowType.java
// public enum WindowType  {
//     DEFAULT,
//     FULLSCREEN,
//     CUSTOM
// }


// Path: src/main/java/net/technicpack/minecraftcore/mojang/version/io/Rule.java
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import net.technicpack.minecraftcore.launch.ILaunchOptions;
import net.technicpack.minecraftcore.launch.WindowType;
import net.technicpack.utilslib.OperatingSystem;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

            String os = OperatingSystem.getOperatingSystem().getName();
            String osVersion = System.getProperty("os.version");
            String archProp = System.getProperty("os.arch").toLowerCase();
            return (name == null || name.equalsIgnoreCase(os))
                    && (version == null || version.matcher(osVersion).matches())
                    && (arch == null || archProp.contains(arch.toLowerCase()));
        }

        @Override
        public void serialize(JsonObject root) {
            JsonObject os = new JsonObject();
            if (name != null) os.addProperty("name", name);
            if (version != null) os.addProperty("version", version.pattern());
            if (arch != null) os.addProperty("arch", arch);
            root.add("os", os);
        }

    }

    private static class CustomResolutionCondition implements RuleCondition {

        private final boolean shouldHaveCustomResolution;

        CustomResolutionCondition(boolean shouldHaveCustomResolution) {
            this.shouldHaveCustomResolution = shouldHaveCustomResolution;
        }

        @Override
        public boolean test(ILaunchOptions opts) {
            return opts != null
                    && (opts.getLaunchWindowType() == WindowType.CUSTOM) == shouldHaveCustomResolution;