forge/arma/server/addons/task/functions/objects/fnc_TargetEntityController.sqf
Jacob Schmidt 9deb73ec8e Migrate task logic to object classes
- Move task implementations from prototype scripts into `functions/objects`
- Keep public task functions as compatibility adapters
- Update docs and init wiring for the new object-based layout
2026-05-15 18:50:28 -05:00

42 lines
1.1 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Object-style target entity controller.
*/
#pragma hemtt ignore_variables ["_self"]
GVAR(TargetEntityController) = createHashMapFromArray [
["#base", GVAR(EntityControllerBaseClass)],
["#type", "TargetEntityController"],
["#create", compileFinal {
params [
["_taskID", "", [""]],
["_entity", objNull, [objNull]],
["_controllerParams", createHashMap, [createHashMap]]
];
_self call ["initializeControllerState", [_taskID, _entity, "target", _controllerParams]];
_self call ["registerInstance", []];
}],
["#delete", compileFinal {
_self call ["unregisterInstance", []];
}],
["runLoop", compileFinal {
if !(_self call ["registerTaskEntity", ["targets"]]) exitWith {
_self call ["markAborted", []];
_self call ["cleanup", []];
false
};
_self call ["markActive", []];
waitUntil {
sleep 1;
!(_self call ["isEntityUsable", []])
};
_self call ["markFinished", []];
_self call ["cleanup", []];
true
}]
];