ThemModdingHerds.TFHRES 1.2.0

dotnet add package ThemModdingHerds.TFHRES --version 1.2.0
NuGet\Install-Package ThemModdingHerds.TFHRES -Version 1.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ThemModdingHerds.TFHRES" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ThemModdingHerds.TFHRES --version 1.2.0
#r "nuget: ThemModdingHerds.TFHRES, 1.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ThemModdingHerds.TFHRES as a Cake Addin
#addin nuget:?package=ThemModdingHerds.TFHRES&version=1.2.0

// Install ThemModdingHerds.TFHRES as a Cake Tool
#tool nuget:?package=ThemModdingHerds.TFHRES&version=1.2.0

Them's Fightin' Herds Resource reader/writer

A library for reading/writing .tfhres files from Them's Fightin' Herds

Usage

Getting items

using ThemModdingHerds.Resource;
using ThemModdingHerds.Resource.Data;

Database database = new Database(pathToTfhresFile);

// required for any actions
database.Open();

// get all CachedImage records
List<CachedImage> images = database.ReadCachedImage();

// don't forget to close afterwards
database.Close();

Updating items

using ThemModdingHerds.Resource;
using ThemModdingHerds.Resource.Data;

Database database = new Database(pathToTfhresFile);

// required for any actions
database.Open();

// imagine we got this CachedImage "image" from "database.ReadCachedImage()"

image.Height = 100; // Change property

database.Update(image);

// don't forget to close afterwards
database.Close();

Adding new item(s)

using ThemModdingHerds.Resource;
using ThemModdingHerds.Resource.Data;

Database database = new Database(pathToTfhresFile);

// required for any actions
database.Open();

// the HiberliteId property isn't required
CachedTextfile textfile = new()
{
    Shortname = "deez nuts",
    SourceFile = "very/cool/path",
    TextData = Encoding.UTF8.GetBytes("hah, gottem")
};

// add item to databse. this also be a list of the same item type
database.Insert(textfile);

// don't forget to close afterwards
database.Close();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 108 2/12/2024
1.1.1 120 12/25/2023
1.1.0 124 12/25/2023
1.0.2 90 12/23/2023
1.0.1 106 12/22/2023
1.0.0 113 12/22/2023