public int checkRules(Object rules) throws InvocationTargetException, IllegalAccessException {
        int total = 0;
        for (Method method : rules.getClass().getMethods()) {
            if (method.isAnnotationPresent(EngineRule.class)) {
                if (!method.getReturnType().equals(Integer.class) && !method.getReturnType().equals(Integer.TYPE)) {
                    throw new MalformedOutputFromRuleException(method);
                }
                EngineRule annotation = method.getAnnotation(EngineRule.class);
                if (!annotation.disabled()) {
                    ArrayList<Object> arguments = new ArrayList<Object>();
                    for (Class<?> parameter : method.getParameterTypes()) {
                        if (parameter.equals(Player.class)) {
                            arguments.add(player);
                        }
                        else if (parameter.equals(Board.class)) {
                            arguments.add(board);
                        }
                        else {
                            throw new MalformedInputFromRuleException(parameter);
                        }
                    }
                    total += (Integer) method.invoke(rules, arguments.toArray());
                }
            }
        }
        return total;
    }