public ModValidator( Stream stream ) { resources = GameResources.Deserialize( GetResourceManifest() ); ExpansionResourcesUsed = new GameResources(); mod = ContentDirectory.Create( stream ); }
public ModValidator(string path) { resources = GameResources.Deserialize(GetResourceManifest()); ExpansionResourcesUsed = new GameResources(); mod = ContentDirectory.Create(path, false); }
public ModValidator( string path ) { resources = GameResources.Deserialize( GetResourceManifest() ); ExpansionResourcesUsed = new GameResources(); mod = ContentDirectory.Create( path, false ); }
public ModValidator(Stream stream) { resources = GameResources.Deserialize(GetResourceManifest()); ExpansionResourcesUsed = new GameResources(); mod = ContentDirectory.Create(stream); }
private void AddFileResources(ContentDirectory source, string extension, FileResourceType type) { foreach (var file in source.EnumerateFiles(String.Format("*.{0}", extension), SearchOption.AllDirectories)) { AddFileResource(source, type, file); } }
private void PopulateXmlResources(ContentDirectory source) { var files = source.EnumerateXmlFiles(DredmorInfo.XmlFilesToLoadResources, SearchOption.AllDirectories); foreach (var file in files) { XDocument doc = XDocument.Load(file.OpenRead()); switch (file.Name.ToLower()) { case "craftdb.xml": PopulateCraftResources(doc, file.ExpansionNumber); break; case "itemdb.xml": PopulateItemResources(doc, file.ExpansionNumber); PopulatePowerResources(doc, file.ExpansionNumber); break; case "mondb.xml": PopulateMonsterResources(doc, file.ExpansionNumber); PopulateTaxaResources(doc, file.ExpansionNumber); break; case "soundfx.xml": PopulateSfxResources(doc, file.ExpansionNumber); break; case "spelldb.xml": PopulateSpellResources(doc, file.ExpansionNumber); break; } } }
private void PopulatePhysicalResources(ContentDirectory source) { AddFileResources(source, "png", FileResourceType.Image); AddFileResources(source, "spr", FileResourceType.Sprite); AddFileResources(source, "wav", FileResourceType.Wave); AddFileResources(source, "pal", FileResourceType.Palette); AddXmlSpriteResources(source); AddAnimationResources(source); }
private void PopulateResources(ContentDirectory source) { PopulatePhysicalResources(source); PopulateXmlResources(source); if (source.IsCoreGame) { AddHardCodedResources(); } }
private void AddFileResource(ContentDirectory source, FileResourceType type, ContentFile file) { this.Files.Add( new FileResource { Path = file.SourceRelativePath.ToForwardSlashes(), ExpansionNumber = file.ExpansionNumber, Type = type } ); }
private void AddXmlSpriteResources(ContentDirectory source) { //This ignores the "DB" XML files from the search and considers all other XMl files as sprite files. var xmlSpriteFiles = source.EnumerateFiles("*.xml", SearchOption.AllDirectories) .Where(p => !DredmorInfo.AllContentXmlFiles.Any(q => q == p.Name.ToLower())); foreach (var file in xmlSpriteFiles) { AddFileResource(source, FileResourceType.XmlSprite, file); } }
private void AddAnimationResources(ContentDirectory source) { var animationFirstFrames = source.EnumerateFiles("*0000.png", SearchOption.AllDirectories); foreach (var file in animationFirstFrames) { this.Animations.Add( new AnimationResource { Name = file.SourceRelativePath.Replace("0000.png", String.Empty).ToLower().ToForwardSlashes(), FrameCount = GetAnimationFrameCount(file), ExpansionNumber = file.ExpansionNumber } ); } }
public CoreValidator(string path) { core = ContentDirectory.Create(path, true); }
/// <summary> /// Loads all references and resources from the specified source. /// </summary> /// <param name="source"></param> public void LoadResources(ContentDirectory source) { PopulateResources(source); }
public CoreValidator( string path ) { core = ContentDirectory.Create( path, true ); }