public static ThingTypeStorage Load(string path, Core.Version version) { ThingTypeStorage storage = new ThingTypeStorage(); if (storage.InternalLoad(path, version, ClientFeatures.None)) { return(storage); } return(null); }
public static ThingTypeStorage Create(Core.Version version) { ThingTypeStorage storage = new ThingTypeStorage(); if (storage.InternalCreate(version, ClientFeatures.None)) { return(storage); } return(null); }
public static ThingTypeStorage Load(string path, Core.Version version) { ThingTypeStorage storage = new ThingTypeStorage(); if (storage.InternalLoad(path, version, ClientFeatures.None)) { return storage; } return null; }
public static ThingTypeStorage Create(Core.Version version) { ThingTypeStorage storage = new ThingTypeStorage(); if (storage.InternalCreate(version, ClientFeatures.None)) { return storage; } return null; }
public bool Unload() { if (!this.Loaded) { return false; } if (this.Things != null) { this.Things.ProgressChanged -= new ProgressHandler(this.StorageProgressChanged_Handler); this.Things.StorageChanged -= new ThingListChangedHandler(this.ThingListChanged_Handler); this.Things.StorageCompiled -= new EventHandler(this.StorageCompiled_Handler); this.Things.StorageDisposed -= new EventHandler(this.StorageDisposed_Handler); this.Things.Dispose(); this.Things = null; } if (this.Sprites != null) { this.Sprites.ProgressChanged -= new ProgressHandler(this.StorageProgressChanged_Handler); this.Sprites.StorageChanged -= new SpriteListChangedHandler(this.SpriteListChanged_Handler); this.Sprites.StorageCompiled -= new EventHandler(this.StorageCompiled_Handler); this.Sprites.StorageDisposed -= new EventHandler(this.StorageDisposed_Handler); this.Sprites.Dispose(); this.Sprites = null; } this.spriteCache.Clear(); if (this.ClientUnloaded != null) { this.ClientUnloaded(this, new EventArgs()); } return true; }
public bool Load(string datPath, string sprPath, Core.Version version, ClientFeatures features) { if (datPath == null) { throw new ArgumentNullException("datPath"); } if (sprPath == null) { throw new ArgumentNullException("sprPath"); } if (version == null) { throw new ArgumentNullException("version"); } this.Things = ThingTypeStorage.Load(datPath, version, features); if (this.Things == null) { return false; } this.Sprites = SpriteStorage.Load(sprPath, version, features); if (this.Sprites == null) { return false; } this.Things.ProgressChanged += new ProgressHandler(this.StorageProgressChanged_Handler); this.Things.StorageChanged += new ThingListChangedHandler(this.ThingListChanged_Handler); this.Things.StorageCompiled += new EventHandler(this.StorageCompiled_Handler); this.Things.StorageDisposed += new EventHandler(this.StorageDisposed_Handler); this.Sprites.StorageChanged += new SpriteListChangedHandler(this.SpriteListChanged_Handler); this.Sprites.ProgressChanged += new ProgressHandler(this.StorageProgressChanged_Handler); this.Sprites.StorageCompiled += new EventHandler(this.StorageCompiled_Handler); this.Sprites.StorageDisposed += new EventHandler(this.StorageDisposed_Handler); if (this.Loaded && this.ClientLoaded != null) { this.ClientLoaded(this, new EventArgs()); } return this.Loaded; }