My issue seems simple enough to me, but I can't break it down the the bare essentials to be able to program it into my game.
First of all different professions requires different skills, these skills are contained inside the class Person
. I have a world map
where I can ask for all empty buildings, thereby finding all available jobs.
With this information I want to calculate from some weights that the player can modify on each profession to how important it is to be fill a certain position.
so my current approach would be something like this pseudo code:
Job findJob(wm : WorldMap) {
Queue priority <- empty;
for each building {
queue.add(skill * need);
}
return prority.max();
}
Does that sound inefficient stupid or do you see any special cases that you think I should be aware of?