Opened 2 years ago
Closed 2 years ago
#6363 closed task (fixed)
Split tasks from ProductionQueue.
Reported by: | Freagarach | Owned by: | Freagarach |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 26 |
Component: | Simulation | Keywords: | refactoring |
Cc: | Patch: | Phab:D4333 |
Description
As it stands now, the Production Queue (PQ) takes care of quite some stuff (producing units and researching techs). In my recent train trips, I've thought out some way to reduce its scope a bit.
Why: The PQ should only care about its queue, getting that done and delegating specific tasks to components specialised in those specifics.
How: This means that we should have two more components (for now).
- Researcher.
- Trainer (do notice it technically should be able to produce structures).
In this scenario, the PQ gets an order to produce a unit, it delegates that to the trainer
component and adds an item to its queue to keep track of the progress. Here, the trainer
does the hard work of resources, population etc.
Idem for the researcher
component.
Caveats: One thing to discuss is how to handle doing work. Is it the PQ telling the specific component that it may do stuff on every timeout (seems sane), or keep it for the components itself (how to handle fractions of timeouts then?).
It undoes some of the work I've done towards having both a tech and a unit in the same queue item, but I think I was overengineering that anyway.
Change History (2)
comment:1 by , 2 years ago
Owner: | set to |
---|---|
Patch: | → Phab:D4333 |
comment:2 by , 2 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In 26000: