|
|
@@ -13,7 +13,7 @@ namespace GamecraftModdingAPI.Events |
|
|
|
/// </summary> |
|
|
|
public class SimpleEventHandlerEngine : IEventHandlerEngine |
|
|
|
{ |
|
|
|
public object type { get; set; } |
|
|
|
public int type { get; set; } |
|
|
|
public string Name { get; set; } |
|
|
|
|
|
|
|
private bool isActivated = false; |
|
|
@@ -71,7 +71,7 @@ namespace GamecraftModdingAPI.Events |
|
|
|
/// <param name="type">The type of event to handle</param> |
|
|
|
/// <param name="name">The name of the engine</param> |
|
|
|
/// <param name="simple">A useless parameter to use to avoid Python overload resolution errors</param> |
|
|
|
public SimpleEventHandlerEngine(Action activated, Action removed, object type, string name, bool simple = true) |
|
|
|
public SimpleEventHandlerEngine(Action activated, Action removed, int type, string name, bool simple = true) |
|
|
|
: this((EntitiesDB _) => { activated.Invoke(); }, (EntitiesDB _) => { removed.Invoke(); }, type, name) { } |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -81,12 +81,18 @@ namespace GamecraftModdingAPI.Events |
|
|
|
/// <param name="removed">The operation to do when the event is destroyed (if applicable)</param> |
|
|
|
/// <param name="type">The type of event to handler</param> |
|
|
|
/// <param name="name">The name of the engine</param> |
|
|
|
public SimpleEventHandlerEngine(Action<EntitiesDB> activated, Action<EntitiesDB> removed, object type, string name) |
|
|
|
public SimpleEventHandlerEngine(Action<EntitiesDB> activated, Action<EntitiesDB> removed, int type, string name) |
|
|
|
{ |
|
|
|
this.type = type; |
|
|
|
this.Name = name; |
|
|
|
this.onActivated = activated; |
|
|
|
this.onDestroyed = removed; |
|
|
|
} |
|
|
|
|
|
|
|
public SimpleEventHandlerEngine(Action activated, Action removed, EventType type, string name, bool simple = true) |
|
|
|
: this((EntitiesDB _) => { activated.Invoke(); }, (EntitiesDB _) => { removed.Invoke(); }, (int)type, name) { } |
|
|
|
|
|
|
|
public SimpleEventHandlerEngine(Action<EntitiesDB> activated, Action<EntitiesDB> removed, EventType type, string name, bool simple = true) |
|
|
|
: this(activated, removed, (int)type, name) { } |
|
|
|
} |
|
|
|
} |