Example #1
0
        public static void StackPushObject(NWN.Object value, bool defAsObjSelf)
        {
            if (value == null)
            {
                value = defAsObjSelf ? OBJECT_SELF : OBJECT_INVALID;
            }

            StackPushObject_Native(value.m_ObjId);
        }
Example #2
0
        private static void ExecuteClosure(ulong eventId)
        {
            Closure closure = m_Closures[eventId];

            OBJECT_SELF = closure.m_Object;
            BeginClosure(closure.m_Object.m_ObjId);
            closure.m_Func();
            m_Closures.Remove(eventId);
        }
Example #3
0
 public static void ClosureActionDoCommand(NWN.Object obj, ActionDelegate func)
 {
     if (ClosureActionDoCommand_Native(obj.m_ObjId, m_NextEventId) != 0)
     {
         m_Closures.Add(m_NextEventId++, new Closure {
             m_Object = obj, m_Func = func
         });
     }
 }
Example #4
0
 public static void ClosureActionDoCommand(NWN.Object obj, ActionDelegate func)
 {
     if (NativeFunctions.ClosureActionDoCommand(obj.Self, NextEventId) != 0)
     {
         Closures.Add(NextEventId++, new Closure {
             OwnerObject = obj, Run = func
         });
     }
 }
Example #5
0
        public static int OnRunScript(string script, uint oidSelf)
        {
            int ret = 0;

            OBJECT_SELF = oidSelf;
            ScriptContexts.Push(new ScriptContext {
                OwnerObject = oidSelf, ScriptName = script
            });
            try
            {
                ret = NWN.Entrypoints.OnRunScript(script, oidSelf);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            ScriptContexts.Pop();
            OBJECT_SELF = ScriptContexts.Count == 0 ? OBJECT_INVALID : ScriptContexts.Peek().OwnerObject;
            return(ret);
        }
Example #6
0
 public NWArea(Object o)
     : base(o)
 {
 }
Example #7
0
 public override int GetHashCode()
 {
     return(Object.GetHashCode());
 }
 public static void AssignCommand(NWN.Object oActionSubject, ActionDelegate aActionToAssign)
 {
     Internal.ClosureAssignCommand(oActionSubject, aActionToAssign);
 }
Example #9
0
 public NWPlaceable(Object nwnObject)
     : base(nwnObject)
 {
 }
Example #10
0
 private static void PopScriptContext()
 {
     s_ScriptContexts.Pop();
     OBJECT_SELF = s_ScriptContexts.Count == 0 ? OBJECT_INVALID : s_ScriptContexts.Peek();
 }
Example #11
0
 private static void PushScriptContext(uint oid)
 {
     s_ScriptContexts.Push(oid);
     OBJECT_SELF = oid;
 }
Example #12
0
 public NWPlayer(Object nwnObject)
     : base(nwnObject)
 {
 }