/// <summary> /// Creates new instance of this type. /// </summary> /// <param name="triggeringEntityId">The identifier of the entity that has triggered the event.</param> /// <param name="areaId">The identifier of the area that has been triggered.</param> /// <param name="areaEntityId">The identifier of the entity associated with the area that has been triggered.</param> /// <param name="fade">If the event is <see cref="EntityEvent.MoveNearArea"/> determines how close the entity is to the area.</param> public EntityAreaPositionEventArgs(EntityId triggeringEntityId, int areaId, int areaEntityId, float fade) { this.TriggeringEntityId = triggeringEntityId; this.AreaId = areaId; this.AreaEntityId = areaEntityId; this.FadeRatio = fade; }
private static GameObjectExtension CreateWrapper(string entityTypeName, IntPtr handle, EntityId id) { // Get the type that will manage the entity. Type entityType; // Create a new managed wrapper. if (GameObjectExtension.EntityTypeRegistry.TryGetValue(entityTypeName, out entityType)) { return (GameObjectExtension)Activator.CreateInstance(entityType, handle, id); } return null; }
public static extern void RemoteInvocation(EntityId entityId, EntityId targetId, string methodName, object[] args, NetworkTarget target, int channelId);
/// <summary> /// Raises event <see cref="AttachedTo"/> /// </summary> /// <param name="id">Identifier of another entity.</param> protected virtual void OnAttachedTo(EntityId id) { if (this.AttachedTo != null) this.AttachedTo(this, new EventArgs<EntityId>(id)); }
/// <summary> /// </summary> /// <param name="id"> </param> /// <param name="pos"> </param> /// <param name="maxResults"> </param> /// <param name="forceCalculation"> </param> /// <returns> </returns> public static IEnumerable<AreaQueryResult> QueryAreas(EntityId id, Vector3 pos, int maxResults, bool forceCalculation) { var objAreas = EntityInterop.QueryAreas(id, pos, maxResults, forceCalculation); return objAreas.Cast<AreaQueryResult>(); }
public static extern IntPtr GetGameObject(EntityId id);
/// <summary> /// Creates a wrapper object for an entity. /// </summary> /// <param name="handle">Pointer to the entity object.</param> /// <param name="identifier">Identifier of the entity to create the wrapper for.</param> public EntityWrapper(IntPtr handle, EntityId identifier) { this.Handle = handle; this.Identifier = identifier; this.managed = -1; }
public static extern IntPtr BindAttachmentToEntity(IntPtr attachmentPtr, EntityId id);
public void Value(string name, ref EntityId obj, string policy = null) { ValueEntityId(this.Handle, name, ref obj.Value, policy); }
internal static extern object GetManagedObject(IntPtr handle, EntityId id);
public static extern IntPtr AddEntityLink(IntPtr entPtr, string linkName, EntityId otherId, EntityGuid otherGuid);
public static extern object SpawnEntity(EntitySpawnParams spawnParams, bool autoInit, out IntPtr entityHandle, out EntityId id);
public static extern void SetEntityLinkTarget(IntPtr linkPtr, EntityId target);
public static extern void RemoveEntity(EntityId entityId, bool forceRemoveNow = false);
protected virtual void OnEnterNearArea(EntityId entityId, int areaId, EntityId areaEntityId) { }
/// <summary> /// Binds entity to this attachment. /// </summary> /// <param name="entityId">Identifier of the entity to bind this attachment to.</param> public void SwitchToEntityObject(EntityId entityId) { EntityInterop.BindAttachmentToEntity(this.Handle, entityId); }
/// <summary> /// Creates a wrapper for an entity. /// </summary> /// <param name="id">Identifier of the entity.</param> /// <param name="ptr">Entity's handle.</param> public NativeEntity(EntityId id, IntPtr ptr) { this.Id = id; this.EntityHandle = ptr; }
internal static extern FlowInputData CreateEntityId(EntityId value);
/// <summary> /// Creates a wrapper object for an entity. /// </summary> /// <param name="identifier"> /// Identifier of the entity to create the wrapper for. /// </param> public EntityWrapper(EntityId identifier) { this.Handle = Native.EntityInterop.GetEntity(identifier); this.Identifier = identifier; this.managed = -1; }
/// <summary> /// Sent when entity leaves the area proximity. /// </summary> /// <param name="entityId"></param> protected virtual void OnLeaveArea(EntityId entityId, int areaId, EntityId areaEntityId) { }
/// <summary> /// Creates new instance of this type. /// </summary> /// <param name="triggeringEntityId">The identifier of the entity that has triggered the event.</param> /// <param name="areaId">The identifier of the area that has been triggered.</param> /// <param name="areaEntityId">The identifier of the entity associated with the area that has been triggered.</param> public EntityAreaPositionEventArgs(EntityId triggeringEntityId, int areaId, int areaEntityId) { this.TriggeringEntityId = triggeringEntityId; this.AreaId = areaId; this.AreaEntityId = areaEntityId; }
/// <summary> /// Sent when entity moves inside the area proximity. /// </summary> /// <param name="entityId"></param> protected virtual void OnMoveInsideArea(EntityId entityId, int areaId, EntityId areaEntityId) { }
/// <summary> /// Initializes base properties of this class. /// </summary> /// <param name="handle"> Pointer to IEntity object in native memory.</param> /// <param name="identifier">Identifier of this entity.</param> protected GameObjectExtension(IntPtr handle, EntityId identifier) : base(handle, identifier) { }
protected virtual void OnMoveNearArea(EntityId entityId, int areaId, EntityId areaEntityId, float fade) { }
public void Value(string name, ref EntityId obj, string policy = null) { if (this.IsWriting) this.StartWrite(new ObjectReference(name, obj)); else obj = (EntityId)this.StartRead().Value; }
/// <summary> /// Called whenever another entity has been unlinked from this entity. /// </summary> /// <param name="child"></param> protected virtual void OnDetach(EntityId child) { }
/// <summary> /// Raises event <see cref="AreaCrossed"/>. /// </summary> /// <param name="id">Identifier of the trespasser.</param> protected virtual void OnAreaCrossed(EntityId id) { if (this.AreaCrossed != null) this.AreaCrossed(this, new EventArgs<EntityId>(id)); }
/// <summary> /// Called whenever this entity is unliked from another entity. /// </summary> /// <param name="parent"></param> protected virtual void OnDetachThis(EntityId parent) { }
/// <summary> /// Raises event <see cref="DetachedFrom"/> /// </summary> /// <param name="id">Identifier of another entity.</param> protected virtual void OnDetachedFrom(EntityId id) { if (this.DetachedFrom != null) this.DetachedFrom(this, new EventArgs<EntityId>(id)); }
public static extern object[] QueryAreas(EntityId id, Vector3 vPos, int maxResults, bool forceCalculation);