/// <summary> /// Create and initialized UODataManager object, wich represent viewmodel and logic of UO data. /// </summary> /// <param name="uri">Folder path to client data or data-server address. At this momment only local path are supported.</param> /// <param name="type">Combination of flags to specify general behavior of UOEngine. /// * if you want to use _x version of maps and statics use UseExtFacet flag (only for SA and HS), /// * to use special abilities of UOEngine you need additional files, to do it use UseExtFiles flag.</param> /// <param name="language">Specify language that used in data files and server.</param> /// <param name="dataoptions">Additional options. Set it 'null' for autodetect.</param> /// <param name="realtime">If true, engine will save all data at realtime, otherwise it will caching them and save changes in local folder.</param> public UODataManager(Uri uri, UODataType type, Language language, UODataOptions dataoptions = null, bool realtime = true) { if (uri == null || type == 0 || language == null) { throw new ArgumentException("Bad parametre values"); } if (m_Instanes.ContainsKey(uri)) { throw new ArgumentException("Already inited with selected Uri"); } Location = uri; DataType = type; Language = language; RealTime = realtime; m_Instanes[uri] = this; dataOptions = dataoptions ?? new UODataOptions(Location); dataFactory = (type.HasFlag(UODataType.UseMulFiles) || type.HasFlag(UODataType.UseUopFiles)) ? new ClassicFactory(this) : null; // Initialize data... its loading, wait, wait // TODO: We need separeted thread for data working StorageMaps = dataFactory.GetMapFacets(); StorageLand = dataFactory.GetLandTiles(); StorageItem = dataFactory.GetItemTiles(); StorageGump = dataFactory.GetGumpSurfs(); StorageAnim = dataFactory.GetAnimations(); }
/// <summary> /// Create and initialized UODataManager object, wich represent viewmodel and logic of UO data. /// </summary> /// <param name="uri">Folder path to client data or data-server address. At this momment only local path are supported.</param> /// <param name="type">Combination of flags to specify general behavior of UOEngine. /// * if you want to use _x version of maps and statics use UseExtFacet flag (only for SA and HS), /// * to use special abilities of UOEngine you need additional files, to do it use UseExtFiles flag.</param> /// <param name="language">Specify language that used in data files and server.</param> /// <param name="dataoptions">Additional options. Set it 'null' for autodetect.</param> /// <param name="realtime">If true, engine will save all data at realtime, otherwise it will caching them and save changes in local folder.</param> public UODataManager(Uri uri, UODataType type, Language language, UODataOptions dataoptions = null, bool realtime = true) { CheckValues(uri, type, language, dataoptions, realtime); Location = uri; DataType = type; Language = language; RealTime = realtime; m_Instanes[uri] = this; dataOptions = dataoptions ?? new UODataOptions(Location); dataFactory = (type.HasFlag(UODataType.UseMulFiles) || type.HasFlag(UODataType.UseUopFiles)) ? new ClassicFactory(this) : null; if (dataFactory == null) { return; } // Initialize data... its loading, wait, wait // TODO: We need separeted thread for data working _storageMaps = dataFactory.GetMapFacets(); _storageLand = dataFactory.GetLandTiles(); _storageItem = dataFactory.GetItemTiles(); _storageGump = dataFactory.GetGumpSurfs(); _storageAnim = dataFactory.GetAnimations(); }
/// <summary> /// Create and initialized UODataManager object, wich represent viewmodel and logic of UO data. /// </summary> /// <param name="uri">Folder path to client data or data-server address. At this momment only local path are supported.</param> /// <param name="type">Combination of flags to specify general behavior of UOEngine. /// * if you want to use _x version of maps and statics use UseExtFacet flag (only for SA and HS), /// * to use special abilities of UOEngine you need additional files, to do it use UseExtFiles flag.</param> /// <param name="language">Specify language that used in data files and server.</param> /// <param name="dataoptions">Additional options. Set it 'null' for autodetect.</param> /// <param name="realtime">If true, engine will save all data at realtime, otherwise it will caching them and save changes in local folder.</param> public UODataManager(Uri uri, UODataType type, Language language, UODataOptions dataoptions = null, bool realtime = true) { if (uri == null || type == 0 || language == null) throw new ArgumentException("Bad parametre values"); if (m_Instanes.ContainsKey(uri)) throw new ArgumentException("Already inited with selected Uri"); Location = uri; DataType = type; Language = language; RealTime = realtime; m_Instanes[uri] = this; dataOptions = dataoptions ?? new UODataOptions(Location); dataFactory = (type.HasFlag(UODataType.UseMulFiles) || type.HasFlag(UODataType.UseUopFiles)) ? new ClassicFactory(this) : null; // Initialize data... its loading, wait, wait // TODO: We need separeted thread for data working StorageMaps = dataFactory.GetMapFacets(); StorageLand = dataFactory.GetLandTiles(); StorageItem = dataFactory.GetItemTiles(); StorageGump = dataFactory.GetGumpSurfs(); StorageAnim = dataFactory.GetAnimations(); }