11.03.2016, 07:29
@Su37Erich: Why not create an abstract, parent class that defines all the things that jobs have in comon(for example name or location). Then extend it by creating a PilotJob, TruckDriverJob and so on.
Personally, I tried following Shoebill standarts(from various examples) as much as possible. This is the files and their purpose in my Job module.
JobDao.java an interface for all saving, loading, etc.
JobManager.java registers and handles all the relevant events(for example loading jobs once gamemode is initialized).
Job.java an interface that defines things ALL jobs must have
JobCommands.java - the commands
That's my recent design, but since the my jobs got even bigger so now I have a different package for each job and the JobManager creates each of those managers.
I pass the eventManager to my JobManager from my main, onEnable.
Personally, I tried following Shoebill standarts(from various examples) as much as possible. This is the files and their purpose in my Job module.
JobDao.java an interface for all saving, loading, etc.
JobManager.java registers and handles all the relevant events(for example loading jobs once gamemode is initialized).
Job.java an interface that defines things ALL jobs must have
JobCommands.java - the commands
That's my recent design, but since the my jobs got even bigger so now I have a different package for each job and the JobManager creates each of those managers.
I pass the eventManager to my JobManager from my main, onEnable.