Terasology / NameGenerator

This module adds name generators.
2 stars 9 forks source link

Replace MarkovChains with external implementation #13

Closed msteiger closed 9 years ago

msteiger commented 9 years ago

Depends on https://github.com/Terasology/MarkovChains/pull/1

Cervator commented 9 years ago

With MarkovChains added locally and the NameGenerator markov branch in place I get two compile errors (on Java 1.7.0_55):

C:\Dev\Terasology\Git\integrate\Terasology\modules\NameGenerator\src\main\java\org\terasology\namegenerator\generators\MarkovNameGenerator.java
Error:(69, 34) java: local variable sourceNames is accessed from within inner class; needs to be declared final
Error:(74, 24) java: local variable sourceNames is accessed from within inner class; needs to be declared final

Errors at at lines 69 and 74

            @Override
            public Character[] get(int index) {
                return wrapChars(sourceNames.get(index));
            }

            @Override
            public int size() {
                return sourceNames.size();
            }

Goes away simply enough by declaring sourceNames final, so that's easy :-)

To finish this we also need to add MarkovChains to the main module lineup as a stable module. I can set all that up if you'll confirm the fix and inclusion, or feel free to do any part you like :-)

msteiger commented 9 years ago

Thanks for the hint @Cervator!