SimulationTree.Data.Systems
0.3.9
Prefix Reserved
dotnet add package SimulationTree.Data.Systems --version 0.3.9
NuGet\Install-Package SimulationTree.Data.Systems -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.Systems" 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.Systems" Version="0.3.9" />
<PackageReference Include="SimulationTree.Data.Systems" />
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.Systems --version 0.3.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SimulationTree.Data.Systems, 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.Systems@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.Systems&version=0.3.9
#tool nuget:?package=SimulationTree.Data.Systems&version=0.3.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Data Systems
Implements the data project with a system that loads data from various sources.
Loading from an entity
DataSource source = new(world, "fileA");
source.WriteUTF8("Some data here!");
DataRequest request = new(world, "fileA");
simulator.Update();
using ByteReader reader = new(request.CreateByteReader());
Span<char> dataBuffer = stackalloc char[32];
uint textLength = reader.ReadUTF8Span(dataBuffer);
string loadedData = dataBuffer.Slice(0, textLength).ToString();
Console.WriteLine($"Loaded data from an entity {loadedData}");
Loading from file on disk
DataRequest request = new(world, "C:/fileB.txt");
simulator.Update();
using ByteReader reader = new(request.CreateByteReader());
Span<char> dataBuffer = stackalloc char[32];
uint textLength = reader.ReadUTF8Span(dataBuffer);
string loadedData = dataBuffer.Slice(0, textLength).ToString();
Console.WriteLine($"Loaded data from a file {loadedData}");
Loading from an embedded resource
Embedded resources in a project can be loaded if their address is registered:
public readonly struct MyEmbeddedResources : IEmbeddedResourceBank
{
void IEmbeddedResourceBank.Load(Register register)
{
register.Invoke("Assets/test.txt");
}
}
EmbeddedResourceRegistry.Load<MyEmbeddedResources>();
DataRequest request = new(world, "Assets/test.txt");
simulator.Update();
using ByteReader reader = new(request.CreateByteReader());
Span<char> dataBuffer = stackalloc char[32];
uint textLength = reader.ReadUTF8Span(dataBuffer);
string loadedData = dataBuffer.Slice(0, textLength).ToString();
Console.WriteLine($"Loaded data from an embedded resource {loadedData}");
Loading through a message
Data can be loaded by another system through the LoadData message:
LoadData message = new("Assets/test.txt");
simulator.Broadcast(ref message);
if (message.TryConsume(out ByteReader data))
{
Span<char> dataBuffer = stackalloc char[32];
uint textLength = data.ReadUTF8Span(dataBuffer);
string loadedData = dataBuffer.Slice(0, textLength).ToString();
Console.WriteLine($"Loaded data through a message {loadedData}");
data.Dispose();
}
else
{
Console.WriteLine("Failed to load data through a message");
}
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- SimulationTree.Collections (>= 0.3.9)
- SimulationTree.Data.Core (>= 0.3.9)
- SimulationTree.Simulation.Core (>= 0.3.9)
- SimulationTree.Unmanaged.Core (>= 0.3.9)
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 |
|---|---|---|
| 0.3.9 | 222 | 9/24/2025 |