Beispiel #1
0
        internal unsafe DummyItem(Identity identity)
        {
            Identity none    = Identity.None;
            IntPtr   pEngine = N3Engine_t.GetInstance();
            IntPtr   pItem   = N3EngineClientAnarchy_t.GetItemByTemplate(pEngine, identity, &none);

            if (pItem == IntPtr.Zero)
            {
                throw new Exception($"DummyItem::DummyItem - Unable to locate item {identity}");
            }

            Pointer  = pItem;
            Identity = (*(MemStruct *)pItem).Identity;
            Name     = Utils.UnsafePointerToString((*(MemStruct *)pItem).Name);
        }
Beispiel #2
0
        internal unsafe DummyItem(int lowId, int highId, int ql)
        {
            Identity none    = Identity.None;
            IntPtr   pEngine = N3Engine_t.GetInstance();

            if (!CreateDummyItemID(lowId, highId, ql, out Identity dummyItemId))
            {
                throw new Exception($"Failed to create dummy item. LowId: {lowId}\tLowId: {highId}\tLowId: {ql}");
            }

            IntPtr pItem = N3EngineClientAnarchy_t.GetItemByTemplate(pEngine, dummyItemId, &none);

            if (pItem == IntPtr.Zero)
            {
                throw new Exception($"DummyItem::DummyItem - Unable to locate item. LowId: {lowId}\tLowId: {highId}\tLowId: {ql}");
            }

            Pointer  = pItem;
            Identity = (*(MemStruct *)pItem).Identity;
            Name     = Utils.UnsafePointerToString((*(MemStruct *)pItem).Name);
        }