public GMXFile() { Sprites = new SpriteCollection(); Sound = new SoundCollection(); Backgrounds = new BackgroundCollection(); Paths = new PathCollection(); Scripts = new ScriptCollection(); Fonts = new FontCollection(); TimeLines = new TimeLineCollection(); Objects = new ObjectCollection(); Rooms = new RoomCollection(); Includes = new IncludedFileCollection(); Configs = new ConfigCollection(); ResourceTree = new ResourceTree(); }
public GameMakerFile() { Sprites = new SpriteCollection(); Sounds = new SoundCollection(); Backgrounds = new BackgroundCollection(); Paths = new PathCollection(); Scripts = new ScriptCollection(); Fonts = new FontCollection(); TimeLines = new TimeLineCollection(); Objects = new ObjectCollection(); Rooms = new RoomCollection(); Triggers = new TriggerCollection(); Includes = new IncludedFileCollection(); Constants = new ConstantCollection(); Information = new GameInformation(); Settings = new GameSettings(); ResourceTree = new ResourceTree(); }
protected override void ProcessResource(TimeLineCollection aTimelines) { var files = GetXmlFiles(Directories.TimeLines); if (files.Any()) { OnCategoryProcessing(ResourceTypes.TimeLines); var previous = SetCurrentDirectory(Directories.TimeLines); foreach (var file in files) { var document = LoadXml(file); if (document != null) { var timeLine = new TimeLine() { Name = GetElement(document, "Name").Value, ID = GetElementValue <int>(document, "ID") }; foreach (var element in document.Element("Moments").Elements("Moment")) { var moment = new TimeLine.Moment(); moment.Position = int.Parse(element.Attribute("Position").Value); moment.Actions.AddRange(ReadActions(element.Element("Actions"))); timeLine.Moments.Add(moment); } aTimelines.Add(timeLine); } OnAbortProcessingCallback(); } OnCategoryProcessed(ResourceTypes.TimeLines); SetCurrentDirectory(previous); } }
protected abstract void ProcessResource( TimeLineCollection aTimelines );
protected abstract void ProcessResource(TimeLineCollection aTimelines);
protected override void ProcessResource( TimeLineCollection aTimeLines ) { if ( !aTimeLines.Any() ) return; OnCategoryProcessing( ResourceTypes.TimeLines ); Directory.CreateDirectory( Directories.TimeLines ); var previous = SetCurrentDirectory( Directories.TimeLines ); foreach ( var timeLine in aTimeLines ) { var document = new XElement( "TimeLine", CreateIndexedResourceNodes( timeLine ), new XElement( "Moments", from moment in timeLine.Moments select new XElement( "Moment", new XAttribute( "Position", moment.Position ), CreateGMActionBranch( moment.Actions ) ) ) ); SaveDocument( document, SafeResourceFilename( timeLine ) + ".xml" ); OnResourceProcessed( timeLine.Name ); } OnCategoryProcessed( ResourceTypes.TimeLines ); SetCurrentDirectory( previous ); }