Пример #1
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));
        }
Пример #2
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();
        }