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:
@@ -46,10 +46,11 @@ struct ERR_ConvoyVehicle {int SupplyToken=0,Index=0;SCR_AIGroup* Group=nullptr;b
|
||||
struct Receipt {string SourceId="convoy-1";};
|
||||
struct ERR_ConvoyTask {bool Stopped=false,Ready=true;struct Receipt receipt;struct Receipt* Receipt=&receipt;std::vector<ERR_ConvoyVehicle*> Vehicles;};
|
||||
struct Service {ERR_ConvoyTask* task=nullptr;int Count(){return task?1:0;}ERR_ConvoyTask* At(int){return task;}ERR_ConvoyTask* Find(string id){return task&&task->Receipt->SourceId==id?task:nullptr;}
|
||||
bool resumeAllowed=true;bool CanResumeCombat(ERR_ConvoyTask*){return resumeAllowed;}
|
||||
int calls=0;bool valid=true;ERR_ConvoyCombatOrder* last=nullptr;
|
||||
bool ApplyCombatOrder(ERR_ConvoyTask* task,ERR_ConvoyCombatOrder* o,float){calls++;last=o;if(!task||!valid)return false;
|
||||
auto s=task->Vehicles.at(o->VehicleIndex)->Combat;s->Held=o->Hold;s->LastCommandId=o->CommandId;s->ReportId=o->ReportId;s->ObservedAt=o->ObservedAt;return true;}};
|
||||
struct ERR_HQUnit {SCR_AIGroup* Group=nullptr;bool ReservedForSupport=true;void* Radio=this;string ForceSourceId="vehicle-0";
|
||||
struct ERR_HQUnit {int LogisticsReservation=0;SCR_AIGroup* Group=nullptr;bool ReservedForSupport=true;void* Radio=this;string ForceSourceId="vehicle-0";
|
||||
ERR_HQRoute* Downlink=nullptr;ERR_ConvoyCombatOrder* PendingConvoyOrder=nullptr;void* PendingOrder=nullptr;void* PendingTask=nullptr;
|
||||
bool PendingCheckin=false;float NextStatus=0;
|
||||
'''+cancel+r'''
|
||||
@@ -79,7 +80,8 @@ int main(){
|
||||
ERR_HQReport newer=r;newer.MessageId=2;newer.ObservedAt=12000;h.m_Contacts={&newer};h.PlanConvoy(13000);
|
||||
assert(u.PendingConvoyOrder->ReportId==2);u.Downlink->result=1;h.TickDownlink(&u,15000);assert(v.Combat->ReportId==2);
|
||||
h.PlanConvoy(71000);assert(!u.Downlink); // less than60s quiet
|
||||
h.PlanConvoy(72000);assert(u.Downlink&&!u.PendingConvoyOrder->Hold);
|
||||
h.m_Convoys.resumeAllowed=false;h.PlanConvoy(72000);assert(!u.Downlink); // active tactics: do not flood radio with refused resumes
|
||||
h.m_Convoys.resumeAllowed=true;h.PlanConvoy(72000);assert(u.Downlink&&!u.PendingConvoyOrder->Hold);
|
||||
newer.MessageId=3;newer.ObservedAt=73000;u.Downlink->result=1;h.TickDownlink(&u,74000);
|
||||
assert(v.Combat->Held&&h.m_Convoys.calls==2&&!u.Downlink); // new report rejects in-flight RESUME
|
||||
h.m_Network.available=false;h.PlanConvoy(75000);assert(!u.Downlink&&v.Combat->Held);
|
||||
|
||||
Reference in New Issue
Block a user