Esempio n. 1
0
        public static void PutDbObject(IntPtr pDbObject)
        {
            IntPtr pDatabaseHandler  = N3DatabaseHandler_t.Get();
            IntPtr pResourceDatabase = N3DatabaseHandler_t.GetResourceDatabase(pDatabaseHandler);

            ResourceDatabase_t.PutDbObject(pResourceDatabase, pDbObject);
        }
Esempio n. 2
0
        public static void PutDbBlob(Identity identity, byte[] blobData)
        {
            IntPtr pDatabaseHandler  = N3DatabaseHandler_t.Get();
            IntPtr pResourceDatabase = N3DatabaseHandler_t.GetResourceDatabase(pDatabaseHandler);

            ResourceDatabase_t.PutDbBlob(pResourceDatabase, ref identity, blobData, blobData.Length);
        }
Esempio n. 3
0
        public static IntPtr GetDbObject(Identity identity)
        {
            IntPtr pDatabaseHandler  = N3DatabaseHandler_t.Get();
            IntPtr pResourceDatabase = N3DatabaseHandler_t.GetResourceDatabase(pDatabaseHandler);

            return(ResourceDatabase_t.GetDbObject(pResourceDatabase, ref identity));
        }
Esempio n. 4
0
        public static T GetDbObject <T>(Identity identity) where T : DbObject
        {
            IntPtr pDatabaseHandler  = N3DatabaseHandler_t.Get();
            IntPtr pResourceDatabase = N3DatabaseHandler_t.GetResourceDatabase(pDatabaseHandler);


            if (typeof(T) == typeof(PlayfieldDistrictInfo))
            {
                return((T)(object)new PlayfieldDistrictInfo(GetDbObject(identity)));
            }
            return((T)(object)new PlayfieldDistrictInfo(ResourceDatabase_t.GetDbObject(pResourceDatabase, ref identity)));

            if (typeof(T) == typeof(LandControlMap))
            {
                return((T)(object)new LandControlMap(ResourceDatabase_t.GetDbObject(pResourceDatabase, ref identity)));
            }

            if (typeof(T) == typeof(RDBPlayfield))
            {
                return((T)(object)new RDBPlayfield(ResourceDatabase_t.GetDbObject(pResourceDatabase, ref identity)));
            }

            throw new ArgumentException();
        }