Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ResourcePack()

Terraria.IO.ResourcePack.ResourcePack ( IServiceProvider services,
string path,
BrandingType branding = BrandingType::None )
inline

Definition at line 68 of file ResourcePack.cs.

69 {
70 if (File.Exists(path))
71 {
72 IsCompressed = true;
73 }
74 else if (!Directory.Exists(path))
75 {
76 throw new FileNotFoundException("Unable to find file or folder for resource pack at: " + path);
77 }
80 FullPath = path;
82 if (IsCompressed)
83 {
84 _zipFile = ZipFile.Read(path);
85 }
87 }
static bool Exists([NotNullWhen(true)] string? path)
Definition Directory.cs:43
static bool Exists([NotNullWhen(true)] string? path)
Definition File.cs:97
static ? string GetFileName(string? path)
Definition Path.cs:200
readonly BrandingType Branding
readonly IServiceProvider _services
readonly string FullPath
readonly string FileName
readonly ZipFile _zipFile
readonly bool IsCompressed

References Terraria.IO.ResourcePack._services, Terraria.IO.ResourcePack._zipFile, Terraria.IO.ResourcePack.Branding, System.IO.Directory.Exists(), System.IO.File.Exists(), Terraria.IO.ResourcePack.FileName, Terraria.IO.ResourcePack.FullPath, System.IO.Path.GetFileName(), Terraria.IO.ResourcePack.IsCompressed, and Terraria.IO.ResourcePack.LoadManifest().