コード例 #1
0
 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();
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
        protected override void ProcessResource(IncludedFileCollection aIncludes)
        {
            var document = LoadXml(Filenames.IncludedFiles + ".xml");

            if (document != null)
            {
                OnCategoryProcessing(ResourceTypes.IncludedFiles);

                foreach (var element in document.Elements("File"))
                {
                    var include = new IncludedFile();

                    include.Filename              = GetElement(element, "Filename").Value;
                    include.FilePath              = GetElement(element, "FilePath").Value;
                    include.OriginalFileSelected  = GetElementValue <bool>(element, "OriginalFileSelected");
                    include.OriginalFileSize      = GetElementValue <int>(element, "OriginalFileSize");
                    include.FileStored            = GetElementValue <bool>(element, "FileStored");
                    include.ExportType            = GetElementValue <FileExportTypes>(element, "ExportType");
                    include.ExportDirectory       = GetElement(element, "ExportDirectory").Value;
                    include.OverwriteExistingFile = GetElementValue <bool>(element, "OverwriteExistingFile");
                    include.FreeMemoryAfterExport = GetElementValue <bool>(element, "FreeMemoryAfterExport");
                    include.RemoveAtGameEnd       = GetElementValue <bool>(element, "RemoveAtGameEnd");

                    var data = LoadToMemory(GetElement(element, "FileCopyPath").Value);

                    if (data != null)
                    {
                        include.FileStored = true;
                        include.FileData   = data;
                    } // ?

                    aIncludes.Add(include);
                    OnAbortProcessingCallback();
                }

                OnCategoryProcessed(ResourceTypes.IncludedFiles);
            }
        }
コード例 #5
0
 protected abstract void ProcessResource( IncludedFileCollection aIncludes );
コード例 #6
0
 protected abstract void ProcessResource(IncludedFileCollection aIncludes);
コード例 #7
0
        protected override void ProcessResource( IncludedFileCollection aIncludes )
        {
            if ( !aIncludes.Any() )
            return;

              OnCategoryProcessing( ResourceTypes.IncludedFiles );

              Directory.CreateDirectory( Directories.IncludedFiles );
              var document = new XElement( "IncludedFiles" );
              int fileNumber = 0;

              foreach ( var include in aIncludes ) {
            var copyPath = IO.Path.Combine( Directories.IncludedFiles,
                                        IO.Path.GetFileNameWithoutExtension( include.Filename ) + "_" + fileNumber +
                                        IO.Path.GetExtension( include.Filename ) );

            if ( include.FileStored ) {
              using ( var file = File.Create( copyPath ) )
            file.Write( include.FileData, 0, include.FileData.Length );
            }

            document.Add(
              new XElement( "File",
            new XElement( "Filename", include.Filename ),
            new XElement( "FilePath", include.FilePath ),
            new XElement( "OriginalFileSelected", include.OriginalFileSelected ),
            new XElement( "OriginalFileSize", include.OriginalFileSize ),
            new XElement( "FileStored", include.FileStored ),
            ( include.FileStored ? new XElement( "FileCopyPath", copyPath ) : null ),
            new XElement( "ExportType", include.ExportType ),
            new XElement( "ExportDirectory", include.ExportDirectory ),
            new XElement( "OverwriteExistingFile", include.OverwriteExistingFile ),
            new XElement( "FreeMemoryAfterExport", include.FreeMemoryAfterExport ),
            new XElement( "RemoveAtGameEnd", include.RemoveAtGameEnd )
              ) );
              }

              SaveDocument( document, Filenames.IncludedFiles + ".xml" );
              OnCategoryProcessed( ResourceTypes.IncludedFiles );
        }