This repository has been archived by the owner on May 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from RazTools/dev
V1.00.00
- Loading branch information
Showing
190 changed files
with
12,211 additions
and
21,782 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace AssetStudio | ||
{ | ||
public enum AssetGroupOption | ||
{ | ||
ByType, | ||
ByContainer, | ||
BySource, | ||
None | ||
} | ||
} |
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,38 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace AssetStudio | ||
{ | ||
public record AssetIndex | ||
{ | ||
public Dictionary<string, string> Types { get; set; } | ||
public record SubAssetInfo | ||
{ | ||
public string Name { get; set; } | ||
public byte PathHashPre { get; set; } | ||
public uint PathHashLast { get; set; } | ||
} | ||
public Dictionary<int, List<SubAssetInfo>> SubAssets { get; set; } | ||
public Dictionary<int, List<int>> Dependencies { get; set; } | ||
public List<uint> PreloadBlocks { get; set; } | ||
public List<uint> PreloadShaderBlocks { get; set; } | ||
public record BlockInfo | ||
{ | ||
public byte Language { get; set; } | ||
public uint Id { get; set; } | ||
public uint Offset { get; set; } | ||
} | ||
public Dictionary<int, BlockInfo> Assets { get; set; } | ||
public List<uint> SortList { get; set; } | ||
|
||
public AssetIndex() | ||
{ | ||
Types = new Dictionary<string, string>(); | ||
SubAssets = new Dictionary<int, List<SubAssetInfo>>(); | ||
Dependencies = new Dictionary<int, List<int>>(); | ||
PreloadBlocks = new List<uint>(); | ||
PreloadShaderBlocks = new List<uint>(); | ||
Assets = new Dictionary<int, BlockInfo>(); | ||
SortList = new List<uint>(); | ||
} | ||
} | ||
} |
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,49 @@ | ||
using MessagePack; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace AssetStudio | ||
{ | ||
[MessagePackObject] | ||
public record AssetMap | ||
{ | ||
[Key(0)] | ||
public GameType GameType { get; set; } | ||
[Key(1)] | ||
public AssetEntry[] AssetEntries { get; set; } | ||
} | ||
[MessagePackObject] | ||
public record AssetEntry | ||
{ | ||
[Key(0)] | ||
public string Name { get; set; } | ||
[Key(1)] | ||
public string Container { get; set; } | ||
[Key(2)] | ||
public string Source { get; set; } | ||
[Key(3)] | ||
public long PathID { get; set; } | ||
[Key(4)] | ||
public ClassIDType Type { get; set; } | ||
|
||
public bool Matches(Dictionary<string, Regex> filters) | ||
{ | ||
var matches = new List<bool>(); | ||
foreach(var filter in filters) | ||
{ | ||
matches.Add(filter.Key switch | ||
{ | ||
string value when value.Equals(nameof(Name), StringComparison.OrdinalIgnoreCase) => filter.Value.IsMatch(Name), | ||
string value when value.Equals(nameof(Container), StringComparison.OrdinalIgnoreCase) => filter.Value.IsMatch(Container), | ||
string value when value.Equals(nameof(Source), StringComparison.OrdinalIgnoreCase) => filter.Value.IsMatch(Source), | ||
string value when value.Equals(nameof(PathID), StringComparison.OrdinalIgnoreCase) => filter.Value.IsMatch(PathID.ToString()), | ||
string value when value.Equals(nameof (Type), StringComparison.OrdinalIgnoreCase) => filter.Value.IsMatch(Type.ToString()), | ||
_ => throw new NotImplementedException() | ||
}); | ||
} | ||
return matches.Count(x => x == true) == filters.Count; | ||
} | ||
} | ||
} |
Oops, something went wrong.