Integrate delivered HQ memory, finite physical convoy and RHS WCS dependencies
This commit is contained in:
@@ -48,7 +48,10 @@ struct Retained : Command {
|
||||
void Tick(float) override {tactics++;events.push_back("tactics");}
|
||||
void Stop() override {stops++;pending=false;events.push_back("stop");}
|
||||
};
|
||||
struct ForceBoundary {int clears=0;void Clear(){clears++;}};
|
||||
struct Mode {
|
||||
ForceBoundary m_Forces,m_ForceAgents;
|
||||
int forceTicks=0;void TickForces(float){forceTicks++;}
|
||||
bool m_Stopped=false,m_NativeEndHandled=false,m_StartedPlayers=false;int m_Phase=1;
|
||||
float m_NoSurvivorsSince=-1;std::string m_EndReason;
|
||||
Work extraction{0,"extraction",{}},radio{0,"radio",{}},recovery{0,"recovery",{}};
|
||||
@@ -67,7 +70,7 @@ int main(){
|
||||
// Retained work receives exactly one maintenance call on an empty server,
|
||||
// including later ticks, without tactical decisions, observer updates or OnTick.
|
||||
{reset();Mode m;Retained c;m.m_Command=&c;m.m_NoSurvivorsSince=100;
|
||||
m.ServerTick();world.now=2234;m.ServerTick();assert(c.maintenance==2&&c.time==2234&&c.tactics==0&&c.pending);
|
||||
m.ServerTick();world.now=2234;m.ServerTick();assert(c.maintenance==2&&c.time==2234&&c.tactics==0&&c.pending&&m.forceTicks==2);
|
||||
assert(players.controller.updates==0&&m.m_OnTick.calls==0&&m.m_NoSurvivorsSince==-1);}
|
||||
// Populated ticks have exactly one maintenance call before ordinary decisions.
|
||||
{reset();players.count=1;Mode m;Retained c;m.m_Command=&c;m.ServerTick();assert(c.maintenance==1&&c.tactics==1);
|
||||
@@ -93,7 +96,7 @@ int main(){
|
||||
// Stop removes the existing callback before the command receives terminal Stop;
|
||||
// no maintenance drain loop or new scheduling has been introduced in Core.
|
||||
{reset();Mode m;Retained c;m.m_Command=&c;Entity group{true},other{false};m.m_OwnedEntities={&group,&other};
|
||||
m.StopServices();m.StopServices();m.ServerTick();assert(c.stops==1&&c.maintenance==0&&!c.pending&&deleted==1);
|
||||
m.StopServices();m.StopServices();m.ServerTick();assert(c.stops==1&&c.maintenance==0&&!c.pending&&deleted==1&&m.m_Forces.clears==1&&m.m_ForceAgents.clears==1&&m.forceTicks==0);
|
||||
assert((queue.removed==std::vector<std::string>{"StartScenario","ServerTick","BindLocalObserver"}));
|
||||
assert((events==std::vector<std::string>{"stop","onstop"}));}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user