// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.common.util;

import javax.annotation.Nonnull;

public class SystemUtil
{
    public static final SystemType TYPE;
    
    @Nonnull
    private static SystemType getSystemType() {
        final String osName = System.getProperty("os.name");
        if (osName.startsWith("Windows")) {
            return SystemType.WINDOWS;
        }
        if (osName.startsWith("Mac OS X")) {
            return SystemType.MACOS;
        }
        if (osName.startsWith("Linux")) {
            return SystemType.LINUX;
        }
        if (osName.startsWith("LINUX")) {
            return SystemType.LINUX;
        }
        return SystemType.OTHER;
    }
    
    public static boolean getEnvBoolean(@Nonnull final String name) {
        final String value = System.getenv(name);
        return value != null && !"false".equalsIgnoreCase(value) && !"0".equals(value) && !"no".equalsIgnoreCase(value);
    }
    
    static {
        TYPE = getSystemType();
    }
    
    public enum SystemType
    {
        WINDOWS, 
        MACOS, 
        LINUX, 
        OTHER;
    }
}
