Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditableEntityInteraction.c
Go to the documentation of this file.
3 {
4  static const int ROOT = -1;
5 
12  sealed bool CanSetParent(SCR_EditableEntityComponent parentEntity, EEditableEntityInteractionFlag interactionFlags = int.MAX)
13  {
14  if (parentEntity)
15  return CanSetParent(parentEntity.GetEntityType(), parentEntity.GetEntityFlags(), interactionFlags);
16  else
17  return CanSetParent(ROOT, 0, interactionFlags);
18  }
26  bool CanSetParent(EEditableEntityType parentType, EEditableEntityFlag parentFlags, EEditableEntityInteractionFlag interactionFlags = int.MAX)
27  {
28  if (!SCR_Enum.HasFlag(interactionFlags, EEditableEntityInteractionFlag.DELEGATE) || !SCR_Enum.HasFlag(interactionFlags, EEditableEntityInteractionFlag.LAYER_EDITING))
29  return false;
30 
31  if (parentType == ROOT)
32  return true;
33 
34  if (!SCR_Enum.HasFlag(interactionFlags, EEditableEntityInteractionFlag.DELEGATE))
35  return false;
36 
37  if ((parentFlags & EEditableEntityFlag.LAYER) != EEditableEntityFlag.LAYER)
38  return false;
39 
40  return parentType == EEditableEntityType.GENERIC;
41  }
50  bool CanCreateParentFor(EEditableEntityType newLayerType, EEditableEntityFlag newLayerFlags, SCR_EditableEntityComponent parentEntity, bool CheckParentEntity = true)
51  {
52  if (CheckParentEntity && parentEntity)
53  {
55 
56  if (core)
57  {
58  SCR_EditableEntityInteraction interaction = core.GetEntityInteraction(EEditableEntityType.GENERIC);
59  if (!interaction.CanSetParent(parentEntity))
60  return false;
61  }
62  }
63 
64  return CanSetParent(newLayerType, newLayerFlags);
65  }
66 };
EEditableEntityFlag
EEditableEntityFlag
Unique flags of the entity.
Definition: EEditableEntityFlag.c:5
SCR_EditableEntityCore
Definition: SCR_EditableEntityCore.c:10
SCR_Enum
Definition: SCR_Enum.c:1
ROOT
@ ROOT
Definition: EEditorMenuOverlayRoot.c:7
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
EEditableEntityInteractionFlag
EEditableEntityInteractionFlag
Details of entity interaction.
Definition: EEditableEntityInteractionFlag.c:5
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_EditableEntityInteraction
Definition: SCR_EditableEntityInteraction.c:2
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