Beispiel #1
0
        internal static DBObjEx CreateFrom(Interop.DBObj obj, uint DBType)
        {
            switch (DBType)
            {
            case 7:
                return(new CSetup()
                {
                    Underlying = Interop.CSetup.__CreateInstance(obj.__Instance)
                });

            case 11:
                return(new ImgTex()
                {
                    Underlying = Interop.ImgTex.__CreateInstance(obj.__Instance)
                });

            case 12:
                return(new RenderSurface()
                {
                    Underlying = Interop.RenderSurface.__CreateInstance(obj.__Instance)
                });

            case 13:
                return(new CSurface()
                {
                    Underlying = Interop.CSurface.__CreateInstance(obj.__Instance)
                });

            default:
                throw new NotImplementedException();
            }
        }
Beispiel #2
0
 internal static void OnAfterBlockingGetFromDisk(Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     //if (dataTypesLoadedAsyncCache.Contains(qdid.Type))
     //{
     EnsureObjLoad(qdid, dbobj);
     //}
 }
Beispiel #3
0
 internal static void OnBeforeBlockingGetFromDisk(Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     if (!Caches.CacheDictPtr.TryGetValue(dbocache.__Instance, out var dbocacheex))
     {
         return;
     }
 }
Beispiel #4
0
 internal static void OnAfterBlockingLoadInto(Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     if (!Caches.CacheDictPtr.TryGetValue(dbocache.__Instance, out var dbocacheex))
     {
         return;
     }
 }
Beispiel #5
0
 internal static void OnBeforeBlockingLoadInto(AsyncCache asynccache, Interop.DBObj dbobj, QualifiedDataID qdid, DBOCache dbocache)
 {
     if (!Caches.CacheDictPtr.TryGetValue(dbocache.__Instance, out var dbocacheex))
     {
         return;
     }
     dbocacheex.OnBeforeBlockingLoadIntoBase(dbobj, qdid);
 }
Beispiel #6
0
        internal static void OnSerializeFromCachePack(Interop.DBObj dbobj)
        {
            var id = dbobj.MDID.Id.Id;

            if (id >= 0x0A000000 && id < 0x0A00FFFE)
            {
            }
        }
Beispiel #7
0
        /// <summary>
        /// Called each time after the DBObj is requested by the game engine.
        /// </summary>
        /// <param name="qdid"></param>
        /// <param name="dbobj"></param>
        internal static void OnGetFromDB(QualifiedDataID qdid, Interop.DBObj dbobj)
        {
            var ptr = dbobj.__Instance;

            if (Caches.trackedObjects.Contains(ptr))
            {
                return;
            }
            EnsureObjLoad(qdid, dbobj);
        }
Beispiel #8
0
 /// <summary>
 /// Call this method to ensure that the OnObjLoad is triggered if necessary
 /// </summary>
 private static void EnsureObjLoad(QualifiedDataID qdid, Interop.DBObj dbobj)
 {
     if (dbobj.MPMaintainer == null)
     {
         return;
     }
     if (!Caches.CacheDictPtr.TryGetValue(dbobj.MPMaintainer.__Instance, out var dbocacheex))
     {
         return;
     }
     if (Caches.trackedObjects.Contains(dbobj.__Instance))
     {
         return;
     }
     OnObjLoad(dbocacheex, qdid, dbobj);
 }
Beispiel #9
0
 internal static DBObjEx CreateFrom(Interop.DBObj obj, uint DBType)
 {
     return(CreateFrom(obj.__Instance, DBType));
 }
Beispiel #10
0
 internal abstract void OnBeforeBlockingLoadIntoBase(Interop.DBObj dbobj, QualifiedDataID qdid);
Beispiel #11
0
 internal abstract void OnLoad(Interop.DBObj dbobj, QualifiedDataID qdid);
Beispiel #12
0
 /// <summary>
 /// Called when an object is loaded for the first time.
 /// Note that the timing of this function call may or may not be precise,
 /// determining on the methodology the game engine used to load the object.
 /// This is our best guess for when the object is loaded for the first time.
 /// </summary>
 /// <param name="qdid"></param>
 /// <param name="dbobj"></param>
 private static void OnObjLoad(DBCache cache, QualifiedDataID qdid, Interop.DBObj dbobj)
 {
     Caches.trackedObjects.Add(dbobj.__Instance);
     cache.OnLoad(dbobj, qdid);
 }