using Newtonsoft.Json;
namespace SpaceEngineersBlueprintEditor.Model;
public sealed class Blueprint3DScene
{
[JsonProperty("type")]
public string MessageType { get; } = "scene";
[JsonProperty("name")]
public string Name { get; init; } = string.Empty;
[JsonProperty("grids")]
public List<string> Grids { get; } = [];
[JsonProperty("types")]
public List<Blueprint3DBlockType> Types { get; } = [];
[JsonProperty("blocks")]
public List<Blueprint3DSceneBlock> Blocks { get; } = [];
[JsonProperty("selected")]
public int? SelectedBlockId { get; set; }
}
public sealed class Blueprint3DBlockType
{
[JsonProperty("name")]
public string Name { get; init; } = string.Empty;
[JsonProperty("subtype")]
public string Subtype { get; init; } = string.Empty;
}
/// <summary>
/// Compact JSON representation consumed by the local WebGL editor.
/// </summary>
public sealed class Blueprint3DSceneBlock
{
[JsonProperty("i")]
public int Id { get; init; }
[JsonProperty("g")]
public int GridIndex { get; init; }
[JsonProperty("t")]
public int TypeIndex { get; init; }
[JsonProperty("p")]
public float[] Position { get; init; } = [];
[JsonProperty("s")]
public float[] Size { get; init; } = [];
[JsonProperty("x")]
public float[] AxisX { get; init; } = [];
[JsonProperty("y")]
public float[] AxisY { get; init; } = [];
[JsonProperty("z")]
public float[] AxisZ { get; init; } = [];
[JsonProperty("c")]
public float[] Color { get; init; } = [];
[JsonProperty("m")]
public int[] Minimum { get; init; } = [];
}
using Newtonsoft.Json;
namespace SpaceEngineersBlueprintEditor.Model;
public sealed class Blueprint3DScene
{
[JsonProperty("type")]
public string MessageType { get; } = "scene";
[JsonProperty("name")]
public string Name { get; init; } = string.Empty;
[JsonProperty("grids")]
public List<string> Grids { get; } = [];
[JsonProperty("types")]
public List<Blueprint3DBlockType> Types { get; } = [];
[JsonProperty("blocks")]
public List<Blueprint3DSceneBlock> Blocks { get; } = [];
[JsonProperty("selected")]
public int? SelectedBlockId { get; set; }
}
public sealed class Blueprint3DBlockType
{
[JsonProperty("name")]
public string Name { get; init; } = string.Empty;
[JsonProperty("subtype")]
public string Subtype { get; init; } = string.Empty;
}
/// <summary>
/// Compact JSON representation consumed by the local WebGL editor.
/// </summary>
public sealed class Blueprint3DSceneBlock
{
[JsonProperty("i")]
public int Id { get; init; }
[JsonProperty("g")]
public int GridIndex { get; init; }
[JsonProperty("t")]
public int TypeIndex { get; init; }
[JsonProperty("p")]
public float[] Position { get; init; } = [];
[JsonProperty("s")]
public float[] Size { get; init; } = [];
[JsonProperty("x")]
public float[] AxisX { get; init; } = [];
[JsonProperty("y")]
public float[] AxisY { get; init; } = [];
[JsonProperty("z")]
public float[] AxisZ { get; init; } = [];
[JsonProperty("c")]
public float[] Color { get; init; } = [];
[JsonProperty("m")]
public int[] Minimum { get; init; } = [];
}