Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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
         });
     }
 }
Ejemplo n.º 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
         });
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public NWArea(Object o)
     : base(o)
 {
 }
Ejemplo n.º 7
0
 public override int GetHashCode()
 {
     return(Object.GetHashCode());
 }
Ejemplo n.º 8
0
 public static void AssignCommand(NWN.Object oActionSubject, ActionDelegate aActionToAssign)
 {
     Internal.ClosureAssignCommand(oActionSubject, aActionToAssign);
 }
Ejemplo n.º 9
0
 public NWPlaceable(Object nwnObject)
     : base(nwnObject)
 {
 }
Ejemplo n.º 10
0
 private static void PopScriptContext()
 {
     s_ScriptContexts.Pop();
     OBJECT_SELF = s_ScriptContexts.Count == 0 ? OBJECT_INVALID : s_ScriptContexts.Peek();
 }
Ejemplo n.º 11
0
 private static void PushScriptContext(uint oid)
 {
     s_ScriptContexts.Push(oid);
     OBJECT_SELF = oid;
 }
Ejemplo n.º 12
0
 public NWPlayer(Object nwnObject)
     : base(nwnObject)
 {
 }