15 [
Attribute(
"1", UIWidgets.ComboBox,
category:
"Editable Entity",
desc:
"Decide whether the entity should be registered automatically to the list of editable entities.", enums: ParamEnumArray.FromEnum(
EEditableEntityRegister))]
18 [
Attribute(
"", UIWidgets.Auto,
category:
"Visualization",
desc:
"Icon offset (m) from entity's origin.")]
19 protected vector m_vIconPos;
22 protected bool m_bEnabledVisibilityReplication;
24 [
RplProp(onRplName:
"OnRplVisibilityChanged", condition: RplCondition.Custom, customConditionName:
"CanReplicateVisibility"),
Attribute(
"1",
category:
"Visualization",
desc:
"Set entity's visibility setting. Apart from this custom value, visibility of an entitymay be influenced by other factors like distance to the camera or active layer.")]
25 protected bool m_bVisible;
27 [
Attribute(
category:
"Visualization",
desc:
"Mark entity as static. When static, entity's position is not calculated each frame. Instead, cached position is used.")]
28 protected bool m_bStatic;
30 [
Attribute(
"0",
category:
"Visualization",
desc:
"Max distance in which the entity is drawn.\nWhen 0 or below, default for given type is used.")]
31 protected float m_fMaxDrawDistance;
33 [
Attribute(
"1", UIWidgets.Flags,
category:
"Editable Entity",
desc:
"For editor users to edit or even see the entity, at least one of their editor keys must match entity's keys.\nFOr example, if the entity has KEY_1 and KEY_2, while the editor has KEY_2 and KEY_8, the entity will be available, since both have KEY_2.", enums: ParamEnumArray.FromEnum(
EEditableEntityAccessKey))]
43 protected ref set<SCR_EditableEntityComponent> m_Entities;
44 protected vector m_vStaticPos;
45 protected int m_iIconBoneIndex = -1;
52 string GetDisplayName()
59 displayName = info.GetName();
61 if (!displayName.IsEmpty() || !
m_Owner)
65 displayName =
m_Owner.GetName();
66 if (!displayName.IsEmpty())
67 return "[" + displayName +
"]";
70 return "{" +
m_Owner.Type().ToString() +
"}";
77 ResourceName GetPrefab(
bool shorten =
false)
80 return ResourceName.Empty;
82 EntityPrefabData prefabData =
m_Owner.GetPrefabData();
84 return ResourceName.Empty;
86 ResourceName prefab = prefabData.GetPrefabName();
90 if (shorten && prefab)
93 int guidIndex = prefab.LastIndexOf(
"}");
95 prefab = prefab.Substring(0, guidIndex + 1);
126 return prefabData.GetEntityType();
138 return prefabData.GetEntityInteraction();
149 if (m_UIInfoInstance)
150 return m_UIInfoInstance;
155 return prefabData.GetInfo();
179 m_UIInfoInstance = info;
186 bool IsReplicated(out RplId replicationID = -1)
192 replicationID = Replication.FindId(
this);
193 if (replicationID == -1)
213 if ((m_Flags &
EEditableEntityFlag.LINKED_CHILDREN) && !SCR_EditorLinkComponent.IsSpawned(
this))
226 SetParentEntity(target);
230 protected bool IsServer()
233 return Replication.IsServer() || Replication.Loadtime() || HasEntityFlag(
EEditableEntityFlag.LOCAL);
237 protected bool CanRpc()
254 bool GetPos(out vector pos)
265 else if (m_iIconBoneIndex == -1)
268 pos =
m_Owner.CoordToParent(m_vIconPos);
277 m_Owner.GetAnimation().GetBoneMatrix(m_iIconBoneIndex, transform);
278 pos =
m_Owner.CoordToParent(transform[3] + m_vIconPos);
282 pos =
m_Owner.CoordToParent(m_vIconPos);
300 bool GetTransform(out vector outTransform[4])
305 m_Owner.GetTransform(outTransform);
312 bool GetLocalTransform(out vector outTransform[4])
320 m_Owner.GetLocalTransform(outTransform);
325 m_Owner.GetTransform(outTransform);
328 vector parentTransform[4];
329 if (m_ParentEntity.GetTransform(parentTransform))
330 Math3D.MatrixInvMultiply4(parentTransform, outTransform, outTransform);
356 ScriptInvoker GetOnUIRefresh()
365 ScriptInvoker GetOnUIReset()
400 int GetCrew(out notnull array<CompartmentAccessComponent> crewCompartmentAccess,
bool ignorePlayers =
true);
412 return damageManager.GetHealthScaled();
422 return damageManager && damageManager.IsDamageHandlingEnabled();
435 return damageManager.GetState() ==
EDamageState.DESTROYED;
448 void SetStatic(
bool isStatic)
450 if (isStatic &&
m_Owner.GetFlags() & EntityFlags.ACTIVE)
452 Print(
string.Format(
"Cannot mark '%1' as static, it's marked as EntityFlags.ACTIVE!",
m_Owner), LogLevel.WARNING);
456 m_bStatic = isStatic;
472 void UpdateStaticPos()
478 GetPos(m_vStaticPos);
485 void SetHierarchyAsDirtyInParents()
493 parent.SetHierarchyAsDirty();
494 parent = parent.GetParentEntity();
501 void SetHierarchyAsDirty()
509 void SetTransformWithChildren(vector transform[4])
522 void SetTransform(vector transform[4],
bool changedByUser =
false)
527 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(
m_Owner);
528 if (resourceComponent)
532 resourceGrid.IncreaseGridUpdateId();
534 if (resourceComponent.IsDynamic())
535 resourceGrid.UpdateResourceDynamicItem(resourceComponent);
537 resourceGrid.UpdateResourceStaticItem(resourceComponent);
541 RplComponent rpl = RplComponent.Cast(
m_Owner.FindComponent(RplComponent));
542 vector prevTransform[4];
544 m_Owner.GetWorldTransform(prevTransform);
548 SetHierarchyAsDirtyInParents();
552 if(!System.IsCLIParam(
"clientVehicles"))
554 if (
m_Owner.IsInherited(ChimeraCharacter))
557 Rpc(SetTransformOwner, transform);
562 if (CanRpc()) Rpc(SetTransformOwner, transform);
564 SetTransformOwner(transform);
568 SetTransformBroadcast(transform);
569 if (CanRpc()) Rpc(SetTransformBroadcast, transform);
577 Rpc(SetTransformOwner, transform);
581 SetTransformBroadcast(transform);
582 if (CanRpc()) Rpc(SetTransformBroadcast, transform);
590 core.Event_OnEntityTransformChangedServer.Invoke(
this, prevTransform);
593 rpl.ForceNodeMovement(prevTransform[3]);
597 [
RplRpc(RplChannel.Reliable, RplRcver.Owner)]
598 protected void SetTransformOwner(vector transform[4])
600 BaseGameEntity baseGameEntity = BaseGameEntity.Cast(
m_Owner);
603 baseGameEntity.Teleport(transform);
606 Physics phys = baseGameEntity.GetPhysics();
609 phys.SetVelocity(vector.Zero);
610 phys.SetAngularVelocity(vector.Zero);
616 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
617 protected void SetTransformBroadcast(vector transform[4])
622 float scale =
m_Owner.GetScale();
623 m_Owner.SetWorldTransform(transform);
630 core.Event_OnEntityTransformChanged.Invoke(
this);
640 if (!IsDestroyed() && CanDestroy())
643 damageManager.SetHealthScaled(0);
647 return IsDestroyed();
655 bool Delete(
bool changedByUser =
false,
bool updateNavmesh =
true)
674 array<ref Tuple2<vector, vector>> areas = {};
675 array<bool> redoAreas = {};
676 aiWorld.GetNavmeshRebuildAreas(
GetOwner(), areas, redoAreas);
677 GetGame().GetCallqueue().CallLater(aiWorld.RequestNavmeshRebuildAreas, 1000,
false, areas, redoAreas);
683 SetHierarchyAsDirtyInParents();
686 RplComponent.DeleteRplEntity(
m_Owner,
false);
693 RplId GetOwnerRplId()
695 RplComponent rpl = GetRplComponent();
699 return RplId.Invalid();
705 float GetMaxDrawDistanceSq()
707 return m_fMaxDrawDistance;
713 void SetMaxDrawDistance(
float maxDrawDistance)
715 if (maxDrawDistance <= 0)
718 m_fMaxDrawDistance = maxDrawDistance * maxDrawDistance;
740 bool GetEntityBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets, IEntity owner =
null)
743 if (editableEntityUIInfo)
744 editableEntityUIInfo.GetEntityBudgetCost(outBudgets);
746 return !outBudgets.IsEmpty();
754 bool GetEntityChildrenBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets, IEntity owner =
null)
757 if (editableEntityUIInfo)
759 editableEntityUIInfo.GetEntityChildrenBudgetCost(outBudgets);
761 return !outBudgets.IsEmpty();
767 bool GetEntityAndChildrenBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets, IEntity owner =
null)
770 if (editableEntityUIInfo)
771 editableEntityUIInfo.GetEntityAndChildrenBudgetCost(outBudgets);
773 return !outBudgets.IsEmpty();
781 bool CanDuplicate(out notnull set<SCR_EditableEntityComponent> outRecipients)
787 if (factionAffiliationComponent)
789 Faction faction = factionAffiliationComponent.GetAffiliatedFaction();
791 if (delegateFactionManager)
793 SCR_EditableFactionComponent factionDelegate = delegateFactionManager.GetFactionDelegate(faction);
795 outRecipients.Insert(factionDelegate);
826 if (GetPlayerID() == 0)
829 return interaction.CanSetParent(parentEntity, interactionFlags);
846 if (parentEntity == m_ParentEntity)
852 if (parentEntity ==
this)
854 Log(
"Cannot set parent to itself!",
true, LogLevel.WARNING);
859 if (parentEntity.IsChildOf(
this))
861 Log(
string.Format(
"Cannot set parent to its own child %1!", parentEntity),
true, LogLevel.WARNING);
867 if (!CanSetParent(parentEntity))
875 SetParentEntityBroadcast(parentEntity, parentPrev, changedByUser);
877 Rpc(SetParentEntityBroadcastReceive, Replication.FindId(parentEntity), Replication.FindId(parentPrev), changedByUser);
885 void RestoreParentEntity()
891 SetParentEntityBroadcast(m_ParentEntity, m_ParentEntity);
894 int parentEntityID = Replication.FindId(m_ParentEntity);
895 Rpc(SetParentEntityBroadcastReceive, parentEntityID, parentEntityID,
false);
903 void RemoveParentEntity()
911 OnRegistrationChanged(
false);
913 Rpc(OnRegistrationChanged,
false);
922 return m_ParentEntity;
928 void GetParentEntities(out notnull array<SCR_EditableEntityComponent> entities)
934 entities.Insert(parent);
935 parent = parent.GetParentEntity();
948 if (parent == entity)
951 parent = parent.GetParentEntity();
961 set<SCR_EditableEntityComponent> GetChildrenRef()
972 void GetChildren(out notnull set<SCR_EditableEntityComponent> entities,
bool onlyDirect =
false,
bool skipIgnored =
false)
982 entities.Insert(entity);
984 entity.GetChildren(entities, onlyDirect, skipIgnored);
993 void GetChildren(out notnull set<SCR_EditableEntityComponent> entities,
bool onlyDirect,
EEditableEntityAccessKey accessKey)
1004 if (entity.HasAccessSelf(accessKey))
1006 entities.Insert(entity);
1008 entity.GetChildren(entities, onlyDirect, accessKey);
1017 int GetChildrenCount(
bool onlyDirect =
false)
1031 count += child.GetChildrenCount(onlyDirect);
1072 return this != layersManager.GetCurrentLayer()
1074 && (!toExtreme || GetParentEntity() != layersManager.GetCurrentLayer());
1083 return m_bAutoRegister == -1;
1091 void ForceVehicleCompartments(notnull array<ECompartmentType> forceVehicleCompartments);
1096 m_ParentEntity = parentEntity;
1098 if (parentEntity != parentEntityPrev)
1099 RemoveFromParent(parentEntityPrev, changedByUser);
1101 AddToParent(parentEntity, changedByUser);
1105 core.Event_OnParentEntityChanged.Invoke(
this, parentEntity, parentEntityPrev);
1115 if (!IsRegistered())
1120 m_ParentEntity = parentEntity;
1121 OnRegistrationChanged(
true);
1129 (!parentEntity && IsRegistered())
1132 (parentEntity && parentEntity.IsRegistered() == IsRegistered())
1135 OnParentEntityChanged(parentEntity, parentEntityPrev, changedByUser);
1140 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
1141 protected void SetParentEntityBroadcastReceive(RplId parentEntityID, RplId parentEntityPrevID,
bool changedByUser)
1148 (parentEntityID.IsValid() && !parentEntity)
1149 || (parentEntity && !parentEntity.IsRegistered())
1153 core.AddOrphan(parentEntityID, Replication.FindId(
this));
1157 SetParentEntityBroadcast(parentEntity, parentEntityPrev, changedByUser);
1162 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
1163 protected void OnRegistrationChanged(
bool toRegister)
1165 set<SCR_EditableEntityComponent> children =
new set<SCR_EditableEntityComponent>();
1166 GetChildren(children);
1189 return m_bAutoRegister;
1193 protected void Register()
1201 m_bAutoRegister = -1;
1204 core.RegisterEntity(
this);
1206 SetParentEntityBroadcast(m_ParentEntity, m_ParentEntity);
1209 array<SCR_EditableEntityComponent> orphans = {};
1210 for (
int i = 0, count = core.RemoveOrphans(Replication.FindId(
this), orphans); i < count; i++)
1212 orphans[i].SetParentEntityBroadcast(
this, orphans[i].GetParentEntity());
1213 Print(
string.Format(
"Editor parent %1 restored for orphan %2",
this, orphans[i]), LogLevel.VERBOSE);
1218 protected void Unregister(IEntity owner =
null)
1220 if (!IsRegistered())
1227 core.UnRegisterEntity(
this, owner);
1240 parentEntity.AddChild(
this);
1244 SetHierarchyAsDirtyInParents();
1250 core.AddToRoot(
this);
1261 SetHierarchyAsDirtyInParents();
1263 parentEntity.RemoveChild(
this);
1269 core.RemoveFromRoot(
this);
1276 if (entity.GetParentEntity() !=
this)
1281 m_Entities =
new set<SCR_EditableEntityComponent>();
1286 UpdateGameHierarchy(
m_Owner, entity.GetOwner(),
true);
1290 OnChildEntityChanged(entity,
true);
1296 if (entity.GetParentEntity() ==
this || !
m_Entities)
1311 UpdateGameHierarchy(
m_Owner, entity.m_Owner,
false);
1313 OnChildEntityChanged(entity,
false);
1317 protected void UpdateGameHierarchy(IEntity parent, IEntity child,
bool toAdd)
1319 if (!parent || !child)
1322 if (parent && parent.IsDeleted())
1324 if (child && child.IsDeleted())
1330 parent.AddChild(child, -1, EAddChildFlags.AUTO_TRANSFORM | EAddChildFlags.RECALC_LOCAL_TRANSFORM);
1334 vector transform[4];
1335 child.GetWorldTransform(transform);
1336 parent.RemoveChild(child);
1337 child.SetWorldTransform(transform);
1355 return (m_EntityState & state) == state;
1363 return m_EntityState;
1376 if (m_EntityState & state)
1379 m_EntityState = m_EntityState | state;
1383 if (!(m_EntityState & state))
1386 m_EntityState = m_EntityState &~ state;
1390 SetEntityStateInChildren(
m_Owner, state, toSet);
1399 void ResetEntityStates()
1405 SetEntityStateInChildren(
m_Owner, state,
false);
1428 return (m_Flags & flag) == flag;
1450 m_Flags = m_Flags | flag;
1454 if (!(m_Flags & flag))
1457 m_Flags = m_Flags &~ flag;
1470 protected void SetEntityStateInChildren(IEntity owner,
EEditableEntityState state,
bool toSet, out array<Managed> components =
null)
1487 for (
int i = 0; i < componentsCount; i++)
1490 if (component && component.CanApply(state))
1491 component.EOnStateChanged(GetEntityStates(), state, toSet);
1495 IEntity child = owner.GetChildren();
1498 SetEntityStateInChildren(child, state, toSet, components);
1499 child = child.GetSibling();
1508 protected void OnVisibilityChanged()
1512 core.Event_OnEntityVisibilityChanged.Invoke(
this);
1524 void SetVisible(
bool show)
1527 OnVisibilityChanged();
1529 RplComponent rpl = GetRplComponent();
1530 if (rpl && !rpl.IsProxy())
1531 Replication.BumpMe();
1537 void EnableVisibilityReplication(
bool enable)
1539 RplComponent rpl = GetRplComponent();
1540 if (!rpl || rpl.IsProxy())
1543 m_bEnabledVisibilityReplication = enable;
1544 Replication.BumpMe();
1549 bool CanReplicateVisibility()
1551 return m_bEnabledVisibilityReplication;
1555 void OnRplVisibilityChanged()
1563 bool GetVisibleSelf()
1572 bool GetVisibleInHierarchy()
1575 return m_ParentEntity.GetVisibleInHierarchy();
1577 return GetVisibleSelf();
1586 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
1589 m_AccessKey = accessKey;
1595 core.Event_OnEntityAccessKeyChanged.Invoke(
this);
1598 SCR_AccessKeysEditorComponent accessKeysComponent = SCR_AccessKeysEditorComponent.Cast(SCR_AccessKeysEditorComponent.GetInstance(SCR_AccessKeysEditorComponent));
1600 if (accessKeysComponent)
1601 editorAccessKey = accessKeysComponent.GetAccessKey();
1603 set<SCR_EditableEntityComponent> children =
new set<SCR_EditableEntityComponent>;
1604 GetChildren(children,
false, editorAccessKey);
1607 core.Event_OnEntityAccessKeyChanged.Invoke(child);
1625 if (!IsServer() || HasAccessSelf(accessKey))
1628 m_AccessKey = m_AccessKey | accessKey;
1629 OnAccessKeyChanged(m_AccessKey);
1631 Rpc(OnAccessKeyChanged, m_AccessKey);
1640 if (!IsServer() || !HasAccessSelf(accessKey))
1642 m_AccessKey = m_AccessKey &~ accessKey;
1643 OnAccessKeyChanged(m_AccessKey);
1645 Rpc(OnAccessKeyChanged, m_AccessKey);
1651 void ClearAccessKeys()
1657 OnAccessKeyChanged(m_AccessKey);
1659 Rpc(OnAccessKeyChanged, m_AccessKey);
1676 return m_AccessKey & accessKey;
1686 return m_ParentEntity.HasAccessInHierarchy(accessKey);
1688 return HasAccessSelf(accessKey);
1694 bool HasAccessSelf()
1696 SCR_AccessKeysEditorComponent accessKeysComponent = SCR_AccessKeysEditorComponent.Cast(SCR_AccessKeysEditorComponent.GetInstance(SCR_AccessKeysEditorComponent));
1697 if (!accessKeysComponent)
1700 return HasAccessSelf(accessKeysComponent.GetAccessKey());
1707 bool HasAccessInHierarchy()
1709 SCR_AccessKeysEditorComponent accessKeysComponent = SCR_AccessKeysEditorComponent.Cast(SCR_AccessKeysEditorComponent.GetInstance(SCR_AccessKeysEditorComponent));
1710 if (!accessKeysComponent)
1713 return HasAccessInHierarchy(accessKeysComponent.GetAccessKey());
1723 protected void Refresh()
1727 core.Event_OnEntityRefreshed.Invoke(
this);
1731 protected RplComponent GetRplComponent()
1733 return RplComponent.Cast(
GetOwner().FindComponent(RplComponent));
1737 protected bool ValidateType()
1739 switch (GetEntityType())
1742 return m_Owner.IsInherited(ChimeraCharacter) ||
m_Owner.FindComponent(SCR_EditablePlayerDelegateComponent) !=
null;
1749 return m_Owner.IsInherited(AIGroup);
1752 return m_Owner.IsInherited(AIWaypoint);
1755 return this.
IsInherited(SCR_EditableCommentComponent);
1770 string GetLogText(
string prefix =
"")
1772 string displayName = GetDisplayName();
1774 EntityPrefabData prefabData =
m_Owner.GetPrefabData();
1776 prefabName = FilePath.StripPath(prefabData.GetPrefabName());
1779 for (
int i = 0; i < 50 - prefix.Length() - displayName.Length(); i++)
1784 return string.Format(
"%1%2 | entity: %3, prefab: '%4', pos: %5, flags: %6", displayName, space,
m_Owner, prefabName,
m_Owner.GetOrigin(),
SCR_Enum.FlagsToString(
EEditableEntityFlag, m_Flags));
1792 void Log(
string prefix =
"",
bool onlyDirect =
false, LogLevel logLevel = LogLevel.DEBUG)
1796 Print(
string.Format(prefix +
" - Error: Null m_Owner in %1",
this), LogLevel.WARNING);
1802 Print(prefix +
"+ " + GetLogText(prefix), logLevel);
1809 entity.Log(prefix +
" ");
1811 Log(
string.Format(prefix +
" - Error: Null child in %1!",
this),
true, LogLevel.WARNING)
1816 Print(prefix +
"- " + GetLogText(prefix), logLevel);
1831 Print(prefix +
"+ " + GetLogText(prefix), LogLevel.DEBUG);
1834 if (entity.HasAccessSelf(m_AccessKey))
1835 entity.Log(prefix +
" ", accessKey);
1840 Print(prefix +
"- " + GetLogText(prefix), LogLevel.DEBUG);
1850 int enumCount = enumType.GetVariableCount();
1851 for (
int i = 0; i < enumCount; i++)
1854 if (enumType.GetVariableType(i) ==
int && enumType.GetVariableValue(
null, i, val))
1856 if (HasAccessSelf(val))
1858 if (!output.IsEmpty())
1861 output += enumType.GetVariableName(i);
1865 Print(
string.Format(
"%1 access key: %2", GetDisplayName(), output), LogLevel.DEBUG);
1892 aiWorld.RequestNavmeshRebuildEntity(GetOwnerScripted());
1901 override bool RplSave(ScriptBitWriter writer)
1903 writer.Write(m_AccessKey, 32);
1905 RplId parentID = Replication.FindId(m_ParentEntity);
1906 writer.WriteRplId(parentID);
1913 override bool RplLoad(ScriptBitReader reader)
1915 reader.Read(m_AccessKey, 32);
1918 reader.ReadRplId(parentID);
1920 SetParentEntityBroadcastReceive(parentID, parentID,
false);
1926 override void OnDelete(IEntity owner)
1929 if (m_EntityState == -1)
1933 m_OnDeleted.Invoke(owner);
1938 for (
int i =
m_Entities.Count() - 1; i >= 0; i--)
1948 m_ParentEntity =
null;
1949 RemoveFromParent(parentEntity,
false);
1954 override void OnPostInit(IEntity owner)
1961 if (!ValidateType())
1962 Log(
string.Format(
"Wrong type %1 used!",
typename.EnumToString(
EEditableEntityType, GetEntityType())),
true, LogLevel.WARNING);
1966 SetStatic(m_bStatic);
1973 RplComponent rpl = RplComponent.Cast(
m_Owner.FindComponent(RplComponent));
1978 Print(
string.Format(
"Editable entity @\"%1\" is flagged as LOCAL, but contains RplComponent!", GetPrefab()), LogLevel.ERROR);
1987 Print(
string.Format(
"Editable entity @\"%1\" is missing RplComponent! Maybe try regenerating it again.", GetPrefab()), LogLevel.ERROR);
1994 if (m_fMaxDrawDistance != 0)
1995 m_fMaxDrawDistance *= m_fMaxDrawDistance;
1999 SetParentEntityBroadcast(m_ParentEntity, m_ParentEntity, isAutoRegistration:
true);
2009 if (DiagMenu.GetValue(
SCR_DebugMenuID.DEBUGUI_EDITOR_ENTITIES_DISABLE))
2025 string boneName = prefabData.GetIconBoneName();
2026 if (!boneName.IsEmpty())
2027 m_iIconBoneIndex =
m_Owner.GetAnimation().GetBoneIndex(boneName);
2042 m_bAutoRegister = Math.Min(m_bAutoRegister, parentEntity.GetAutoRegister());
2048 m_ParentEntity = parentEntity;