XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
UTF-8
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; } = [];
}