SimulationTree.Data.Core 0.3.9

Prefix Reserved
dotnet add package SimulationTree.Data.Core --version 0.3.9
                    
NuGet\Install-Package SimulationTree.Data.Core -Version 0.3.9
                    
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="SimulationTree.Data.Core" Version="0.3.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimulationTree.Data.Core" Version="0.3.9" />
                    
Directory.Packages.props
<PackageReference Include="SimulationTree.Data.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SimulationTree.Data.Core --version 0.3.9
                    
#r "nuget: SimulationTree.Data.Core, 0.3.9"
                    
#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.
#:package SimulationTree.Data.Core@0.3.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SimulationTree.Data.Core&version=0.3.9
                    
Install as a Cake Addin
#tool nuget:?package=SimulationTree.Data.Core&version=0.3.9
                    
Install as a Cake Tool

Data

Abstraction of data fetching and data sources.

Requesting data with addresses

Entities with the IsDataRequest component imply that the entity wants to fetch bytes from the address requested, within the timeout specified:

using World world = new();
DataRequest request = new(world, "Assets/text.txt");

//after work is done to load it

Assert.That(request.IsLoaded, Is.True);
ReadOnlySpan<byte> utf8Bytes = request.GetBytes();
Assert.That(new ASCIIText256(utf8Bytes).ToString(), Is.EqualTo("Hello, World!"));

Address mechanisms

  • Can use the * as a wildcard, for skipping text until the next matching character
  • Can refer to embedded resources with file system like paths

Embedded resources

If a project contains embedded resources, and are mean't to be findable with an address. They need to be registered with the EmbeddedResourceRegistry. This can be done manually, or automatically with IEmbeddedResource types and the EmbeddedResourceRegistryLoader:

public readonly struct TextAsset : IEmbeddedResource
{
    readonly Address IEmbeddedResource.Address => "Assets/text.txt";
}

static void Main() 
{
    EmbeddedResourceRegistryLoader.Load();
}

Sources

By default, the minimum source expected to be available are entities with the IsDataSource component. These are wrapped around in the DataSource type.

DataSource source = new(world, "Assets/text.txt");
source.WriteUTF8("Hello, World!");

Systems that implement fetching are encouraged to implement loading from other sources too, as to not limit it to just entities. The data-systems implementation project is an example of this.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on SimulationTree.Data.Core:

Package Downloads
SimulationTree.Data

Describes arbitrary data

SimulationTree.DefaultPresentationAssets

Package Description

SimulationTree.Textures.Systems

Package Description

SimulationTree.Fonts.Systems

Package Description

SimulationTree.Data.Systems

Handles loading data

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.9 392 9/24/2025