Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VehicleFuelCondition.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
5 {
6  [Attribute("3", UIWidgets.ComboBox, "Cond operator", "", ParamEnumArray.FromEnum(SCR_ComparerOperator) )]
7  private SCR_ComparerOperator m_eOperator;
8 
9  [Attribute("2", UIWidgets.EditBox, "Fuel volume", "")]
10  private float m_fValue;
11 
12  //------------------------------------------------------------------------------------------------
15  override bool IsAvailable(SCR_AvailableActionsConditionData data)
16  {
17  if (!data)
18  return false;
19 
20  IEntity vehicle = data.GetCurrentVehicle();
21  if (!vehicle)
22  return false;
23 
24  FuelManagerComponent fuelNode = FuelManagerComponent.Cast(vehicle.FindComponent(FuelManagerComponent));
25  if (!fuelNode)
26  return true;
27 
28  int current = fuelNode.GetTotalFuel();
29 
30  bool result = false;
31 
32  result = SCR_Comparer<int>.Compare(m_eOperator, current, (int)m_fValue);
33  return GetReturnResult(result);
34  }
35 };
SCR_AvailableActionsConditionData
Definition: SCR_AvailableActionsConditionData.c:5
SCR_AvailableActionCondition
A single available action condition representation.
Definition: SCR_AvailableActionsCondition.c:3
SCR_ComparerOperator
SCR_ComparerOperator
Definition: SCR_Comparer.c:2
SCR_VehicleFuelCondition
Returns true if current vehicle fuel volume matches the condition.
Definition: SCR_VehicleFuelCondition.c:4
Attribute
typedef Attribute
Post-process effect of scripted camera.
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468