Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RawAssetLoader"/> class.
        /// </summary>
        /// <param name="strategies">
        /// The strategies.
        /// </param>
        public RawAssetLoader(ILoadStrategy[] strategies)
        {
            var directory = new DirectoryInfo(Environment.CurrentDirectory).FullName;
            var contentDirectory = Path.Combine(directory, "Content");
            if (Directory.Exists(contentDirectory))
            {
                Directory.CreateDirectory(directory);
                directory = contentDirectory;
            }

            this.m_Path = directory;
            this.m_SourcePath = null;

            // Check for the existance of a .source file in the directory; if so, we
            // also search that path.
            if (File.Exists(Path.Combine(this.m_Path, ".source")))
            {
                using (var reader = new StreamReader(Path.Combine(this.m_Path, ".source")))
                {
                    this.m_SourcePath = reader.ReadLine();

                    // Don't scan twice if the source path is the same as the normal path.
                    if (string.Equals(this.m_SourcePath, this.m_Path, StringComparison.OrdinalIgnoreCase))
                    {
                        this.m_SourcePath = null;
                    }
                }
            }

            this.m_Strategies = strategies;
        }
Beispiel #2
0
 public ImageLoader(ILoadStrategy loadStrategy, LocalFileLoader localFileLoader) : base(loadStrategy, localFileLoader)
 {
     loadStrategy.Folder     = "/ImageCache/";
     loadStrategy.FileEncode = www => www.texture.EncodeToPNG();
     if (!Directory.Exists(loadStrategy.Path))
     {
         Directory.CreateDirectory(loadStrategy.Path);
     }
 }
Beispiel #3
0
 public MidiFileStrategy(ILoadStrategy <Sequence> loader)
 {
     _loader = loader;
 }
 public LilypondFileStrategy(ILoadStrategy <string> loader)
 {
     _loader = loader;
 }
Beispiel #5
0
 protected Loader(ILoadStrategy loadStrategy, LocalFileLoader localFileLoader)
 {
     this.loadStrategy    = loadStrategy;
     this.localFileLoader = localFileLoader;
 }
 public DefaultAssetOutOfDateCalculator(ILoadStrategy[] loadStrategies, IRawAssetLoader rawAssetLoader)
 {
     this.m_LoadStrategies = loadStrategies;
     this.m_RawAssetLoader = rawAssetLoader;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BuiltinRawAssetLoader"/> class.
 /// </summary>
 /// <param name="strategies">
 /// The strategies.
 /// </param>
 public BuiltinRawAssetLoader(ILoadStrategy[] strategies)
 {
     this.m_Strategies = strategies;
 }
Beispiel #8
0
 public ImageLoader(ILoadStrategy loadStrategy, LocalFileLoader localFileLoader) : base(loadStrategy, localFileLoader)
 {
     loadStrategy.Folder = "/ImageCache/";
 }
Beispiel #9
0
 public Simulation(ILoadStrategy loadStrategy)
 {
     _loadStrategy = loadStrategy;
 }