Gloam.Data 0.7.0

dotnet add package Gloam.Data --version 0.7.0
                    
NuGet\Install-Package Gloam.Data -Version 0.7.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="Gloam.Data" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gloam.Data" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Gloam.Data" />
                    
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 Gloam.Data --version 0.7.0
                    
#r "nuget: Gloam.Data, 0.7.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.
#:package Gloam.Data@0.7.0
                    
#: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=Gloam.Data&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Gloam.Data&version=0.7.0
                    
Install as a Cake Tool

Gloam.Data

JSON-driven entity management with schema validation for Gloam engine

Overview

Gloam.Data provides a powerful, data-driven approach to game entity management. Define your game entities in JSON with automatic schema validation and efficient serialization using System.Text.Json source generation.

Features

  • JSON-Driven Entities: Define entities in JSON with automatic validation
  • Schema Validation: Auto-generated JSON schemas from C# classes
  • Source Generation: High-performance serialization with JsonSerializerContext
  • Entity Management: Base classes and utilities for game entities
  • Content Loading: Flexible content loading system with multiple providers

Quick Start

using Gloam.Data.Entities;
using Gloam.Data.Json;

// Define an entity in JSON
var playerJson = """
{
  "id": "player",
  "name": "Player Character",
  "visual": {
    "glyph": "@",
    "foreground": "#FFD700"
  },
  "stats": {
    "health": 100,
    "mana": 50
  }
}
""";

// Deserialize with validation
var player = JsonSerializer.Deserialize<PlayerEntity>(playerJson, GloamDataJsonContext.Default.PlayerEntity);

Key Components

  • Entity System: BaseGloamEntity and derived classes
  • JSON Context: GloamDataJsonContext for optimized serialization
  • Schema Validation: JsonSchemaValidator for runtime validation
  • Content Loading: Flexible loading system with multiple content providers

Entity Definition

Entities inherit from BaseGloamEntity and are automatically validated against generated JSON schemas:

public class PlayerEntity : BaseGloamEntity
{
    public VisualComponent Visual { get; set; }
    public StatsComponent Stats { get; set; }
}

Documentation

License

MIT License - see LICENSE for details.

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 (1)

Showing the top 1 NuGet packages that depend on Gloam.Data:

Package Downloads
Gloam.Runtime

High-performance dependency injection host for roguelike games with optimized game loop, scene management, and layer rendering.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0 156 8/31/2025

Initial release with JSON entity system and schema validation.