I have main app file "main.js":
import CharacterModel from './CharacterModel';
export default class MainManager {
constructor(socketio) {
this.io = socketio;
}
setup() {
const character= new CharacterModel();
}
function1(vars) {}
function2(vars) {}
etc...
}
And I have file "CharacterModel.js":
export default class CharacterModel{
constructor() {
this.name = "test"
this.points= 10;
}
start() {
// how to get function1, function2 etc. here?
}
}
How in that case I can access from CharacterModel.js to all or many functions from MainManager? Whats the best way and best for perofrmance if there will be many instances of CharacterModel inside MainManager?