Пример #1
0
 public override void SyncScriptEvents()
 {
     foreach (var ev in ScriptEvents.Keys)
     {
         ScriptEvents[ev].SetLuaFunctionPath(LuaEngine.MakeLuaEntityCallbackName(EntName, ev));
     }
 }
Пример #2
0
 public override void AddScriptEvent(LuaEngine.EEntLuaEventTypes ev)
 {
     if (!IsEventSupported(ev))
     {
         return;
     }
     ScriptEvents.Add(ev, new ScriptEvent(LuaEngine.MakeLuaEntityCallbackName(EntName, ev)));
 }
Пример #3
0
 public override void AddScriptEvent(LuaEngine.EEntLuaEventTypes ev)
 {
     DiagManager.Instance.LogInfo(String.Format("GroundObject.AddScriptEvent({0}): Added script event to {1}!", ev.ToString(), EntName));
     if (!IsEventSupported(ev))
     {
         return;
     }
     ScriptEvents.Add(ev, new ScriptEvent(LuaEngine.MakeLuaEntityCallbackName(EntName, ev)));
 }
Пример #4
0
        /// <summary>
        /// Returns a list of all the lua callbacks this entity is subscribed to currently.
        /// </summary>
        /// <returns></returns>
        public virtual IEnumerable <LuaEngine.EEntLuaEventTypes> ActiveLuaCallbacks()
        {
            List <LuaEngine.EEntLuaEventTypes> callbacks = new List <LuaEngine.EEntLuaEventTypes>();
            var eventstypes = LuaEngine.IterateLuaEntityEvents();

            do
            {
                if (FindEvent(LuaEngine.MakeLuaEntityCallbackName(EntName, eventstypes.Current)) != null)
                {
                    callbacks.Add(eventstypes.Current);
                }
            }while (eventstypes.MoveNext());
            return(callbacks);
        }