3 static const string PORT_COMPARTMENT_TYPE =
"CompartmentTypeIn";
4 static const string PORT_VEHICLE =
"VehicleOut";
5 static const string PORT_COMPARTMENT =
"CompartmentOut";
10 [
Attribute(
"0", UIWidgets.CheckBox,
"Reserve compartment?" )]
11 protected bool m_bReserveCompartment;
13 protected ref array<BaseCompartmentSlot> m_aOutCompartments = {};
16 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
18 BaseCompartmentSlot compartmentOut;
24 return ENodeResult.FAIL;
26 if (!GetVariableIn(PORT_COMPARTMENT_TYPE,compType))
27 compType = m_eCompartmentType;
29 array<IEntity> vehicles = {};
30 group.GetUsableVehicles(vehicles);
32 return ENodeResult.FAIL;
37 if (m_bReserveCompartment)
38 group.AllocateCompartment(compartmentOut);
39 SetVariableOut(PORT_COMPARTMENT, compartmentOut);
40 SetVariableOut(PORT_VEHICLE, vehicle);
41 return ENodeResult.SUCCESS;
43 ClearVariable(PORT_VEHICLE);
44 return ENodeResult.FAIL;
48 protected static ref TStringArray s_aVarsIn = {
53 override TStringArray GetVariablesIn()
59 protected static ref TStringArray s_aVarsOut = {
60 PORT_VEHICLE,PORT_COMPARTMENT
64 override TStringArray GetVariablesOut()
70 override bool VisibleInPalette()
76 override string GetOnHoverDescription()
78 return "GetUsableVehicle: takes vehicles from the list of known vehicles of group and checks if the slot of m_compartmentType is available.\n It does not relaese reservation the found compartment!";