Steps resumed after the worker routes read the game as it is: a sales trial, the intern's PNI round and a failure's incident
While a step of the day waits for the route worker, the player can act. Three steps then resumed on what they had noted before: - a sales trial overtaken by an action ran again with the happy customers as indices into S.biz: a customer dropped meanwhile made one point past the end and the day stopped on an exception. dayAgain() makes the trial's checks, the customer and who is happy again on the game as it is; an offer signed or declined by hand meanwhile is not the desk's; - the intern's PNI round placed the batch's quotes as they were: a PNI ordered by hand while it waited was ordered a second time. pniRequote() quotes each order again just before it is placed; - a failure and the monkey's snip took the last incident after their routing: repaired meanwhile, it was gone or another one. They keep their own incident before the routing, and offer a repair only while it stands.
This commit is contained in:
parent
3c45d7dca1
commit
f3df5e5d23
8 changed files with 98 additions and 10 deletions
|
|
@ -13,6 +13,9 @@ function* dayRun(){const d=yield* dayPreRun();if(d===false)return;yield;yield* d
|
|||
// customer it signs off or null (dayAnswer()): here at once, in play by the route worker.
|
||||
const dayStep=(g,v)=>{UI.tick=true;try{return g.next(v);}finally{UI.tick=false;}};
|
||||
const dayAnswer=y=>offerTrial(y.trial,y.hx);
|
||||
// The same trial overtaken by an action (a customer gone shifts S.biz, so hx no longer points at the right ones):
|
||||
// its checks, the customer and who is happy, made again on the game as it is now.
|
||||
const dayAgain=y=>{const o=y.o;if(!o||!S.offers.includes(o))return null;const b=offerTrialOf(o);return b?offerTrial(b,offerHealthy(b)):null;};
|
||||
function dayGo(g,step=dayStep){let v;for(let s=step(g);!s.done;s=step(g,v)){v=undefined;const y=s.value;if(y===DAY_REST)continue;if(y&&y.trial)v=dayAnswer(y);else compute();}}
|
||||
function dayTick(){dayGo(dayRun());}
|
||||
// dayPre(): the world's morning all at once; dayPreRun() the same with a place or two to let a frame through.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue