I have a class named 'GameMap' which holds a private char[][] named 'map'. I created some utility functions to access/modify this 'map' from outside the class, for example: "setCharAt" that takes int x, int y, char c and does map[y][x] = c. I have another class called 'BotPlayer' which also holds a private char[][] named 'memorizedMap'. I want to use utility functions for this char[][] as well but I do not want to redeclare them inside 'BotPlayer'. I want to be able to call these functions in other classes and I want to be able to access the char[][] array directly inside these classes. For example:
GameMap map = new GameMap();
map.setCharAt(x,y,c);
Also, I do not want BotPlayer extending a parent Map class because it already extends another class.
What is the best practice to approach this?