public void TestExtensionTestMethod()
        {
            IEntityListener extension = CreateExtension();

            string result = extension.Test();

            extension.Context.Log(LogLevel.Debug, result);
        }
Exemple #2
0
 internal static void DispatchEvent(EntityEvent entityEvent, Type entityType,
                                    BaseEntityContext context, DbEntityEntry entry)
 {
     foreach (var eventListener in entitiesChangedListeners.Where(c => TypeHelper.IsSameOrSubclass(c.Key, entityType)))
     {
         IEntityListener listener = (IEntityListener)Activator.CreateInstance(eventListener.Value, false);
         listener.OnEntityEvent(entityEvent, context, entry);
     }
 }
Exemple #3
0
 private void OnSpawn(EntitySpawnEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         if (el.Event == Event.EntitySpawn)
         {
             IEntityListener l = el.Listener as IEntityListener;
             l.OnSpawn(e);
         }
     }
 }
Exemple #4
0
 private void OnDeath(EntityDeathEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         if (el.Event == Event.EntityDeath)
         {
             IEntityListener l = el.Listener as IEntityListener;
             l.OnDeath(e);
         }
     }
 }
Exemple #5
0
 private void OnAttack(EntityAttackEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         if (el.Event == Event.EntityAttack)
         {
             IEntityListener l = el.Listener as IEntityListener;
             l.OnAttack(e);
         }
     }
 }
Exemple #6
0
 private void OnMove(EntityMoveEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         if (el.Event == Event.EntityMove)
         {
             IEntityListener l = el.Listener as IEntityListener;
             l.OnMove(e);
         }
     }
 }
Exemple #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveEntityListener(IEntityListener listener)
 {
     m_listeners.Remove(listener);
 }
Exemple #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="listener"></param>
 public void AddEventListener(IEntityListener listener)
 {
     m_listeners.Add(listener);
 }
        public void TestProductEntityUpdated_WithNameField()
        {
            IEntityListener extension = CreateExtension();

            extension.EntityUpdated(2, new[] { "ProductName" });
        }
        public void TestProductEntityCreated()
        {
            IEntityListener extension = CreateExtension();

            extension.EntityCreated(2);
        }
        public void TestItemEntityUpdated_WithNameField()
        {
            IEntityListener extension = CreateExtension();

            extension.EntityUpdated(1, new[] { "ItemColorId" });
        }
        public void TestItemEntityCreated()
        {
            IEntityListener extension = CreateExtension();

            extension.EntityCreated(1);
        }
        public void TestResourceEntityUpdated_WithResourceTypeField()
        {
            IEntityListener extension = CreateExtension();

            extension.EntityUpdated(1, new[] { "ResourceType" });
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="listener"></param>
 public void RemoveEntityListener(IEntityListener listener)
 {
     m_listeners.Remove(listener);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="listener"></param>
 public void AddEventListener(IEntityListener listener)
 {
     m_listeners.Add(listener);
 }