package engine;

import java.awt.event.KeyEvent;

public class KeyConfiguration {

    private static final KeyConfiguration defaultConfiguration = new KeyConfiguration();

    private int up;
    private int down;
    private int left;
    private int right;

    private int quit;
    private int save;
    private int load;
    private int pause;

    private int menu;

    public KeyConfiguration() {
        defaultConfiguration.up    = KeyEvent.VK_UP;
        defaultConfiguration.down  = KeyEvent.VK_DOWN;
        defaultConfiguration.left  = KeyEvent.VK_LEFT;
        defaultConfiguration.right = KeyEvent.VK_RIGHT;
        defaultConfiguration.quit  = KeyEvent.VK_Q;
        defaultConfiguration.save  = KeyEvent.VK_S;
        defaultConfiguration.load  = KeyEvent.VK_L;
        defaultConfiguration.pause = KeyEvent.VK_P;
        defaultConfiguration.menu  = KeyEvent.VK_ESCAPE;
    }


    public static KeyConfiguration getDefaultConfiguration() {
        return defaultConfiguration;
    }

    public int getUp() {
        return up;
    }

    public int getDown() {
        return down;
    }

    public int getLeft() {
        return left;
    }

    public int getRight() {
        return right;
    }

    public int getQuit() {
        return quit;
    }

    public int getSave() {
        return save;
    }

    public int getLoad() {
        return load;
    }

    public int getPause() {
        return pause;
    }
}

@@ -407,37 +407,16 @@
         
-defaultConfiguration.
 up    = 
@@ -439,37 +439,16 @@
         
-defaultConfiguration.
 down  = 
@@ -473,37 +473,16 @@
         
-defaultConfiguration.
 left  = 
@@ -507,37 +507,16 @@
         
-defaultConfiguration.
 right = 
@@ -542,37 +542,16 @@
         
-defaultConfiguration.
 quit  = 
@@ -573,37 +573,16 @@
         
-defaultConfiguration.
 save  = 
@@ -604,37 +604,16 @@
         
-defaultConfiguration.
 load  = 
@@ -635,37 +635,16 @@
         
-defaultConfiguration.
 pause = 
@@ -670,29 +670,8 @@
     
-defaultConfiguration.
 menu

fix NullPointerException