Capture current mission, AI, map and administration development

Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
This commit is contained in:
2026-10-13 22:52:53 +02:00
parent a951a96edc
commit 6a667d8deb
8104 changed files with 2124945 additions and 2061 deletions
+58
View File
@@ -89,6 +89,64 @@ int main(){
assert(down->Advance(2000,&journal)==0);assert(down->Advance(4000,&journal)==0);assert(down->Advance(6000,&journal)==1);
assert(!down->Originated&&down->OriginDue==-1);for(int j=beforeDown;j<journal.events.Count();j++)assert(journal.events[j].find("CALL")!=0);
auto captured=network.Route(&c[2],true);captured->Advance(0,&journal);c[0].captured=true;assert(captured->Advance(2000,&journal)==-1);c[0].captured=false;
// The sender must stay valid on EVERY observed tick of the two-second hop,
// not only at completion. Recovery before Due cannot revive an interrupted hop.
for(bool downlink:{false,true})for(int reason=0;reason<3;reason++){
auto interrupted=network.Route(downlink?&c[1]:&c[0],downlink);ERR_HQJournal log;
assert(interrupted->Advance(0,&log)==0);
float sendingAt=3000;
if(downlink)sendingAt=2000;
assert(interrupted->Advance(sendingAt,&log)==0&&interrupted->Sending);
if(reason==0)c[0].alive=false;
if(reason==1)c[0].captured=true;
if(reason==2)c[0].radio=0;
assert(interrupted->Advance(sendingAt+1000,&log)==-1);
assert(interrupted->Failed&&log.events.back().find("LOST ")==0);
int terminalEvents=log.events.Count();
c[0].alive=true;c[0].captured=false;c[0].radio=2;
assert(interrupted->Advance(sendingAt+2000,&log)==-1&&log.events.Count()==terminalEvents);
}
// Receiver interruption and leaving/re-entering the link also cancel the
// same physical short-range hop in either direction, before its due time.
for(bool downlink:{false,true})for(int reason=0;reason<4;reason++){
auto interrupted=network.Route(downlink?&c[1]:&c[2],downlink);ERR_HQJournal log;
assert(interrupted->Advance(0,&log)==0);
float sendingAt=downlink?2000:3000;
assert(interrupted->Advance(sendingAt,&log)==0&&interrupted->Sending);
assert(interrupted->Nodes[interrupted->Cursor+1]->Carrier==&c[1]);
if(reason==0)c[1].alive=false;
if(reason==1)c[1].captured=true;
if(reason==2)c[1].radio=0;
if(reason==3)c[1].pos=V(3000);
assert(interrupted->Advance(sendingAt+1000,&log)==-1);
int terminalEvents=log.events.Count();
c[1].alive=true;c[1].captured=false;c[1].radio=1;c[1].pos=V(500);
assert(interrupted->Advance(sendingAt+2000,&log)==-1&&log.events.Count()==terminalEvents);
}
// HQ's first downlink leg has no physical sender; its original receiving
// manpack must still survive while waiting, rather than use a late recovery.
auto firstDown=network.Route(&c[1],true);ERR_HQJournal firstDownLog;
assert(firstDown->Advance(0,&firstDownLog)==0&&firstDown->Cursor==-1);
c[0].radio=1;assert(firstDown->Advance(1000,&firstDownLog)==-1);
c[0].radio=2;assert(firstDown->Advance(2000,&firstDownLog)==-1);
// Healthy receiver-bearing hops keep the cursor and RECEIVE log unchanged
// during intermediate polling, with both 500m boundary links still valid.
for(bool downlink:{false,true}){
auto healthy=network.Route(downlink?&c[1]:&c[2],downlink);ERR_HQJournal log;
assert(healthy->Advance(0,&log)==0);
float sendingAt=downlink?2000:3000;
assert(healthy->Advance(sendingAt,&log)==0&&healthy->Sending);
int cursor=healthy->Cursor,events=log.events.Count();
assert(healthy->Advance(sendingAt+1000,&log)==0&&healthy->Cursor==cursor&&log.events.Count()==events);
assert(healthy->Advance(sendingAt+2000,&log)==(downlink?1:0)&&healthy->Cursor==cursor+1);
}
// Healthy intermediate polling does not transmit early or duplicate log entries.
auto waiting=network.Route(&c[0]);ERR_HQJournal waitingLog;
assert(waiting->Advance(0,&waitingLog)==0&&waiting->Advance(3000,&waitingLog)==0);
int transmittingEvents=waitingLog.events.Count();
assert(waiting->Advance(4000,&waitingLog)==0&&waiting->Sending);
assert(waitingLog.events.Count()==transmittingEvents);
assert(waiting->Advance(5000,&waitingLog)==1&&waitingLog.events.Count()==transmittingEvents+1);
auto timeout=network.Route(&c[2]);timeout->Advance(0,&journal);assert(timeout->Advance(30001,&journal)==-1);
Network disconnected;disconnected.Add(&c[1],&group,1,1);disconnected.Build();assert(!disconnected.Route(&c[1]));
Network boundary;c[1].pos=V(501);boundary.Add(&c[0],&group,1,2);boundary.Add(&c[1],&group,2,1);boundary.Build();assert(!boundary.Route(&c[1]));