package apps.common;

import javax.swing.JFileChooser;
import javax.swing.JPanel;

import util.configuration.ProjectConfiguration;
import util.game.Game;
import util.game.GameRepository;

public class GameLoaderPrompt {
    public static Game loadGameUsingPrompt() {
        NativeUI.setNativeUI();
        JFileChooser fileChooser = new JFileChooser(ProjectConfiguration.gameRulesheetsPath);
        int rval = fileChooser.showOpenDialog(new JPanel());
        if (rval != JFileChooser.APPROVE_OPTION)
            return null;

        return GameRepository.getDefaultRepository().getGame(fileChooser.getSelectedFile().getName().replace(".kif", ""));        
    }
}
@@ -539,16 +539,269 @@
 ull;%0D%0A%0D%0A
+        // TODO: What if, in the future, the default repository is not the local repository?%0D%0A        // What we'd actually like is to display a list of games in the default repository,%0D%0A        // not a list of games pulled from the local hard drive.%0D%0A
         

Add a TODO discussing the direction I'd like to go with GameLoaderPrompt.