/// <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;
 }
Esempio n. 3
0
 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));
 }
Esempio n. 5
0
        /// <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>();
        }
Esempio n. 6
0
 public static extern IntPtr GetGameObject(EntityId id);
Esempio n. 7
0
 /// <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;
 }
Esempio n. 8
0
 public static extern IntPtr BindAttachmentToEntity(IntPtr attachmentPtr, EntityId id);
Esempio n. 9
0
 public void Value(string name, ref EntityId obj, string policy = null)
 {
     ValueEntityId(this.Handle, name, ref obj.Value, policy);
 }
Esempio n. 10
0
 internal static extern object GetManagedObject(IntPtr handle, EntityId id);
Esempio n. 11
0
 public static extern IntPtr AddEntityLink(IntPtr entPtr, string linkName, EntityId otherId, EntityGuid otherGuid);
Esempio n. 12
0
 public static extern object SpawnEntity(EntitySpawnParams spawnParams, bool autoInit,
     out IntPtr entityHandle, out EntityId id);
Esempio n. 13
0
 public static extern void SetEntityLinkTarget(IntPtr linkPtr, EntityId target);
Esempio n. 14
0
 public static extern void RemoveEntity(EntityId entityId, bool forceRemoveNow = false);
Esempio n. 15
0
 protected virtual void OnEnterNearArea(EntityId entityId, int areaId, EntityId areaEntityId)
 {
 }
Esempio n. 16
0
 /// <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);
 }
Esempio n. 17
0
 /// <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;
 }
Esempio n. 18
0
 internal static extern FlowInputData CreateEntityId(EntityId value);
Esempio n. 19
0
 /// <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;
 }
Esempio n. 20
0
 /// <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;
 }
Esempio n. 22
0
 /// <summary>
 /// Sent when entity moves inside the area proximity.
 /// </summary>
 /// <param name="entityId"></param>
 protected virtual void OnMoveInsideArea(EntityId entityId, int areaId, EntityId areaEntityId)
 {
 }
Esempio n. 23
0
 /// <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)
 {
 }
Esempio n. 24
0
 protected virtual void OnMoveNearArea(EntityId entityId, int areaId, EntityId areaEntityId, float fade)
 {
 }
Esempio n. 25
0
 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;
 }
Esempio n. 26
0
 /// <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));
 }
Esempio n. 28
0
 /// <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));
 }
Esempio n. 30
0
 public static extern object[] QueryAreas(EntityId id, Vector3 vPos, int maxResults, bool forceCalculation);