mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-04 20:38:24 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
27 lines
567 B
C#
27 lines
567 B
C#
using System.Text.Json.Nodes;
|
|
|
|
namespace Sandbox;
|
|
|
|
/// <summary>
|
|
/// This is added when a component is missing. It will store the json data of the missing component, so we don't lose any data.
|
|
/// </summary>
|
|
[Expose, Hide]
|
|
public class MissingComponent : Component
|
|
{
|
|
string json { get; }
|
|
|
|
public MissingComponent( JsonObject jso )
|
|
{
|
|
json = jso.ToJsonString();
|
|
Flags |= ComponentFlags.Error;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the Json data that was deserialized
|
|
/// </summary>
|
|
public JsonObject GetJson()
|
|
{
|
|
return JsonObject.Parse( json ) as JsonObject;
|
|
}
|
|
}
|