mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-24 17:39:21 +01:00
ResourceTree: Rework Internal flag, improve null checks, simplify
This commit is contained in:
parent
db9bfb00a3
commit
3da20f2d89
2 changed files with 48 additions and 51 deletions
|
|
@ -15,7 +15,6 @@ public class ResourceNode : ICloneable
|
|||
public Utf8GamePath[] PossibleGamePaths;
|
||||
public FullPath FullPath;
|
||||
public readonly ulong Length;
|
||||
public readonly bool Internal;
|
||||
public readonly List<ResourceNode> Children;
|
||||
internal ResolveContext? ResolveContext;
|
||||
|
||||
|
|
@ -31,14 +30,16 @@ public class ResourceNode : ICloneable
|
|||
}
|
||||
}
|
||||
|
||||
internal ResourceNode(ResourceType type, nint objectAddress, nint resourceHandle, ulong length, bool @internal, ResolveContext? resolveContext)
|
||||
public bool Internal
|
||||
=> Type is ResourceType.Imc;
|
||||
|
||||
internal ResourceNode(ResourceType type, nint objectAddress, nint resourceHandle, ulong length, ResolveContext? resolveContext)
|
||||
{
|
||||
Type = type;
|
||||
ObjectAddress = objectAddress;
|
||||
ResourceHandle = resourceHandle;
|
||||
PossibleGamePaths = Array.Empty<Utf8GamePath>();
|
||||
Length = length;
|
||||
Internal = @internal;
|
||||
Children = new List<ResourceNode>();
|
||||
ResolveContext = resolveContext;
|
||||
}
|
||||
|
|
@ -54,7 +55,6 @@ public class ResourceNode : ICloneable
|
|||
PossibleGamePaths = other.PossibleGamePaths;
|
||||
FullPath = other.FullPath;
|
||||
Length = other.Length;
|
||||
Internal = other.Internal;
|
||||
Children = other.Children;
|
||||
ResolveContext = other.ResolveContext;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue