public void addAllFactories() {
        try {
            File packageDirectory = new File("src/gameObjects");
            String[] packageFiles = packageDirectory.list();
            
            for (int i = 0; i < packageFiles.length; i++) {
                // only get .class files
                if (packageFiles[i].endsWith(".java")) {
                    String className = packageFiles[i].substring(0,
                            packageFiles[i].length() - 5); // remove .class
                                                           // extension
                    Class<?> c = Class.forName("gameObjects." + className);
                    // if class has ForSave annotation, invoke getFactory(), add
                    // to myAllFactories
                    if (c.getAnnotation(ForSave.class) != null) {
                        Method[] methods = c.getMethods();
                        for (Method m : methods) {
                            if (m.getName().equals("getFactory")) {
                                GameObjectFactory gof = (GameObjectFactory) m
                                        .invoke(c);
                                myAllFactories.add(gof);
                            }
                        }
                    }

                }
            }
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } 
    }