Rinum/OpenAnt

Food System specification.

Closed this issue · 4 comments

celx commented

It's unclear in the milestone description how the designers envisioned the Food System to be written; what approaches are encouraged, discouraged, and is there anything of importance that should be kept in mind?

Oipo commented

Great question.

So here's what we want to have: A recurring event where food gets spawned. For simplicity, we'll stick to one source of food. Perhaps in the future we can have different kinds with different effects. Anyways, I think it's best if we both track time and the amount of food on the map.

I recommend using QTimers and qt signals and slots to check per, say, 30 seconds to see if there is less then 10 items of food on the map, and then spawn 100 or so. These numbers are completely arbitrary, of course.

This means that there needs to be some food class/object or so, which the map has a list of. The food object should also obviously have a location, and should, for now, only appear above ground.

Oipo commented

As per IRC: We decided that we might as well use the map.update function for this, instead of replicating it with qtimers/events.

I've started working on this. The current version that I have makes sure that there are at least 20, and at most 100 pieces of food on the map. I'll do a pull request once I get it working to the point that the user can click on food and pick it up (unless I should do one sooner).

With the reboot, I'm closing current issues.