public void TestExtensionTestMethod() { IEntityListener extension = CreateExtension(); string result = extension.Test(); extension.Context.Log(LogLevel.Debug, result); }
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); } }
private void OnSpawn(EntitySpawnEventArgs e) { foreach (EventListener el in Plugins) { if (el.Event == Event.EntitySpawn) { IEntityListener l = el.Listener as IEntityListener; l.OnSpawn(e); } } }
private void OnDeath(EntityDeathEventArgs e) { foreach (EventListener el in Plugins) { if (el.Event == Event.EntityDeath) { IEntityListener l = el.Listener as IEntityListener; l.OnDeath(e); } } }
private void OnAttack(EntityAttackEventArgs e) { foreach (EventListener el in Plugins) { if (el.Event == Event.EntityAttack) { IEntityListener l = el.Listener as IEntityListener; l.OnAttack(e); } } }
private void OnMove(EntityMoveEventArgs e) { foreach (EventListener el in Plugins) { if (el.Event == Event.EntityMove) { IEntityListener l = el.Listener as IEntityListener; l.OnMove(e); } } }
/// <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); }
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" }); }