encoding should be a property of each World Object.

If you want the encoding to be different for each algorithm, pass Encoder class in constructor => Dependency Injection.