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
<PackageReference Include="SimulationTree.Data.Core" Version="0.3.9" />
<PackageVersion Include="SimulationTree.Data.Core" Version="0.3.9" />
<PackageReference Include="SimulationTree.Data.Core" />
paket add SimulationTree.Data.Core --version 0.3.9
#r "nuget: SimulationTree.Data.Core, 0.3.9"
#:package SimulationTree.Data.Core@0.3.9
#addin nuget:?package=SimulationTree.Data.Core&version=0.3.9
#tool nuget:?package=SimulationTree.Data.Core&version=0.3.9
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 | Versions 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. |
-
net9.0
- SimulationTree.Collections (>= 0.3.9)
- SimulationTree.Unmanaged.Core (>= 0.3.9)
- SimulationTree.Worlds.Core (>= 0.3.9)
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 | 391 | 9/24/2025 |