FinalEngine.Resources 2023.4.0-pre

This is a prerelease version of FinalEngine.Resources.
dotnet add package FinalEngine.Resources --version 2023.4.0-pre
NuGet\Install-Package FinalEngine.Resources -Version 2023.4.0-pre
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="FinalEngine.Resources" Version="2023.4.0-pre" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FinalEngine.Resources --version 2023.4.0-pre
#r "nuget: FinalEngine.Resources, 2023.4.0-pre"
#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 FinalEngine.Resources as a Cake Addin
#addin nuget:?package=FinalEngine.Resources&version=2023.4.0-pre&prerelease

// Install FinalEngine.Resources as a Cake Tool
#tool nuget:?package=FinalEngine.Resources&version=2023.4.0-pre&prerelease

FinalEngine.Resources

FinalEngine.Resources provides a set of classes and interfaces that can be used to manager resources within a Final Engine game. The general goal of this library is to provide users with an IResourceManager used to load and unload references to resources.

Getting started

Below you'll find instructions on how to take advantage of this package. Please note that Final Engine is in active development and a full release is still underway.

Prerequisites

First off, you need to make sure you register a resource loader to the resource manager. Standard resource loaders can be found in the FinalEngine.Extensions.Resources package. So, just install the package and you're good to go.

Additionally, you can implement your own resource loader by creating your own implementation of the ResourceLoaderBase<TResource> class. Note that TResource refers to a generic of type IResource.

Usage

Once the additional dependencies have been implemented you can now use the resource manager. To get started, we need to register any and all resource loaders we wish to use. This should be done before loading any resources.

// If for some reason you haven't yet created a file system object, create one.
var fileSystem = new FileSystem();

// Now let's create and register a sound resource loader.
var loader = new SoundResourceLoader(fileSystem);
ResourceManager.Instance.RegisterLoader<ISound>(loader);

Cool, so once all resource loaders are registered you can load and unload resources like so:

// Load a sound.
var sound = ResourceManager.Instance.LoadResource<ISound>("sound.mp3");

// Later on we can unload
ResourceManager.Instance.UnloadResource(sound);

Additional documentation

  • Remember to unload your resources when you're done with them to remove unnecessary references to the resource and free up memory.
  • Refrain from using the Dispose function provided by a loaded resource; this will most likely be omitted in a future release. The resource manager should be responsible for the lifecycle of any and all resources it manages.

Feedback

Want to provide feedback? Perhaps you have a found a bug or wish to provide a feature request? Look no further!

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.
  • net7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FinalEngine.Resources:

Package Downloads
FinalEngine.Audio

This is a library containing interfaces used to handle audio for Final Engine games.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2023.4.0-pre 97 7/11/2023