package de.craften.craftenlauncher;

import com.tngtech.configbuilder.annotation.valueextractor.CommandLineValue;

/**
 * Craften Launcher config class.
 *
 */
public class Config {

    @CommandLineValue(shortOpt = "mcPath", longOpt = "minecraftPath", hasArg = true)
    private String mcPath;

    @CommandLineValue(shortOpt = "server", longOpt = "serverAddress", hasArg = true)
    private String server;

    @CommandLineValue(shortOpt = "xmx", longOpt = "minecaftMemory", hasArg = true)
    private String xmx;

    @CommandLineValue(shortOpt = "version", longOpt = "minecraftVersion", hasArg = true)
    private String version;

    @CommandLineValue(shortOpt = "profileid", longOpt = "usedProfileID", hasArg = true)
    private String profileID;

    @CommandLineValue(shortOpt = "quickplay", longOpt = "startQuickPlay")
    private boolean quickPlay;

    @CommandLineValue(shortOpt = "forcelogin", longOpt = "forceMinecraftLogin")
    private boolean forcelogin;

    @CommandLineValue(shortOpt = "fullscreen", longOpt = "startMinecraftFullscreen")
    private boolean fullscreen;

    public String getMcPath() {
        return mcPath;
    }

    public String getServer() {
        return server;
    }

    public String getXmx() {
        return xmx;
    }

    public String getVersion() {
        return version;
    }

    public boolean isQuickPlay() {
        return quickPlay;
    }

    public boolean isForcelogin() {
        return forcelogin;
    }

    public boolean isFullscreen() {
        return fullscreen;
    }

    public String getProfileID() {
        return profileID;
    }

    public boolean hasMinecraftPath() {
        return mcPath != null;
    }

    public boolean hasServerAddress() {
        return server != null;
    }

    public boolean hasXMXParameter() {
        return xmx != null;
    }

    public boolean hasProfileID() {
        return profileID != null;
    }
}

@@ -150,11 +150,8 @@
 ss.%0A
- *%0A
  */%0A
@@ -209,17 +209,17 @@
 pt = %22mc
-P
+p
 ath%22, lo
@@ -228,25 +228,18 @@
 Opt = %22m
-inecraftP
+cp
 ath%22, ha
@@ -339,23 +339,16 @@
  %22server
-Address
 %22, hasAr
@@ -440,22 +440,11 @@
  = %22
-minecaftMemory
+xmx
 %22, h
@@ -541,18 +541,9 @@
  = %22
-minecraftV
+v
 ersi
@@ -652,21 +652,17 @@
  = %22
-usedP
+p
 rofile
-ID
+id
 %22, h
@@ -767,19 +767,14 @@
  = %22
-startQ
+q
 uick
-P
+p
 lay%22
@@ -874,18 +874,9 @@
 orce
-MinecraftL
+l
 ogin
@@ -973,23 +973,9 @@
  = %22
-startMinecraftF
+f
 ulls

Fix long commandline args to keep compatible to 1.0.0 and previous versions.