-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4412ffa
commit a412902
Showing
84 changed files
with
3,462 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
Emulator/Interfaces/SPD.File.Emulator.Interfaces/ISpdEmulator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using SPD.File.Emulator.Interfaces.Structures.IO; | ||
|
||
namespace SPD.File.Emulator.Interfaces; | ||
|
||
/// <summary> | ||
/// APIs exposed by Spd Emulator. | ||
/// </summary> | ||
public interface ISpdEmulator | ||
{ | ||
/// <summary> | ||
/// Tries to create an emulated SPD file using an SPD file embedded inside another file as source. | ||
/// </summary> | ||
/// <param name="sourcePath">Path to the file from which the data will be sourced.</param> | ||
/// <param name="offset">Offset in the file where the SPD starts.</param> | ||
/// <param name="route">The route of the emulated file.</param> | ||
/// <param name="destinationPath">Path to where the emulated file should be put.</param> | ||
public bool TryCreateFromFileSlice(string sourcePath, long offset, string route, string destinationPath); | ||
|
||
/// <summary> | ||
/// Tries to create an emulated SPD file by merging any applicable sprite or texture files, using the input as the base | ||
/// </summary> | ||
/// <param name="sourcePath">Path to the SPD file to use as a base.</param> | ||
/// <param name="route">The route of the emulated SPD file.</param> | ||
/// <param name="destinationPath">Path to where the emulated SPD file should be put.</param> | ||
public bool TryCreateFromSpd(string sourcePath, string route, string destinationPath); | ||
|
||
/// <summary> | ||
/// Invalidates a file, i.e. unregisters it, will be recreated on next access. | ||
/// </summary> | ||
/// <param name="SPDPath">Path of the SPD file.</param> | ||
public void InvalidateFile(string SPDPath); | ||
|
||
/// <summary> | ||
/// Gets the list of input files from other mods fed into the emulator. | ||
/// </summary> | ||
public RouteGroupTuple[] GetEmulatorInput(); | ||
|
||
/// <summary> | ||
/// Registers an already merged SPD as an emulated one | ||
/// </summary> | ||
/// <param name="sourcePath">The path to the SPD file to register</param> | ||
/// <param name="destinationPath">The path where the emulated SPD file should be put</param> | ||
public void RegisterSpd(string sourcePath, string destinationPath); | ||
|
||
/// <summary> | ||
/// Adds a new file to be injected into emulated SPDs | ||
/// </summary> | ||
/// <param name="file">The path to the file to add</param> | ||
/// <param name="route">The route the file is in</param> | ||
public void AddFile(string file, string route); | ||
|
||
/// <summary> | ||
/// Adds a directory to SPD Emulator so it's like the files were in FEmulator\SPD | ||
/// </summary> | ||
/// <param name="dir">The directory to add the files from</param> | ||
public void AddDirectory(string dir); | ||
} |
9 changes: 9 additions & 0 deletions
9
Emulator/Interfaces/SPD.File.Emulator.Interfaces/SPD.File.Emulator.Interfaces.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
50 changes: 50 additions & 0 deletions
50
Emulator/Interfaces/SPD.File.Emulator.Interfaces/Structures/IO/Structures.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
namespace SPD.File.Emulator.Interfaces.Structures.IO; | ||
|
||
|
||
/// <summary> | ||
/// Represents information tied to an individual directory. | ||
/// </summary> | ||
public struct DirectoryInformation | ||
{ | ||
/// <summary> | ||
/// Full path to the directory. | ||
/// </summary> | ||
public string FullPath; | ||
|
||
/// <summary> | ||
/// Last time this directory was modified. | ||
/// </summary> | ||
public DateTime LastWriteTime; | ||
} | ||
|
||
/// <summary> | ||
/// Groups a single directory and a list of files associated with it. | ||
/// </summary> | ||
public class DirectoryFilesGroup | ||
{ | ||
/// <summary> | ||
/// The directory in question. | ||
/// </summary> | ||
public DirectoryInformation Directory; | ||
|
||
/// <summary> | ||
/// The relative file paths tied to this directory. | ||
/// </summary> | ||
public string[] Files = Array.Empty<string>(); | ||
} | ||
|
||
/// <summary> | ||
/// A tuple representing a group and a route. | ||
/// </summary> | ||
public struct RouteGroupTuple | ||
{ | ||
/// <summary> | ||
/// Route associated with this tuple. | ||
/// </summary> | ||
public string Route; | ||
|
||
/// <summary> | ||
/// Files bound by this route. | ||
/// </summary> | ||
public DirectoryFilesGroup Files; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.