2026-02-03 13:55:13 +01:00
|
|
|
using System;
|
2025-12-18 14:27:27 +01:00
|
|
|
using Babushka.scripts.CSharp.GameEntity.LoadSave;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
|
|
|
|
namespace Babushka.scripts.CSharp.GameEntity.Entities;
|
|
|
|
|
|
2026-02-03 13:55:13 +01:00
|
|
|
public class Entity
|
2025-12-18 14:27:27 +01:00
|
|
|
{
|
2026-02-03 13:55:13 +01:00
|
|
|
public long id;
|
|
|
|
|
public virtual string EntityType => "";
|
|
|
|
|
|
|
|
|
|
public Entity()
|
|
|
|
|
{
|
|
|
|
|
id = new Random().NextInt64();
|
|
|
|
|
}
|
2025-12-18 14:27:27 +01:00
|
|
|
|
2026-02-03 17:30:35 +01:00
|
|
|
public virtual void SaveEntity(JObject json)
|
2025-12-18 14:27:27 +01:00
|
|
|
{
|
2026-02-03 13:55:13 +01:00
|
|
|
json["id"] = id;
|
|
|
|
|
json["type"] = EntityType;
|
2025-12-18 14:27:27 +01:00
|
|
|
}
|
|
|
|
|
|
2026-02-03 17:30:35 +01:00
|
|
|
public virtual void LoadEntity(JObject json)
|
2025-12-18 14:27:27 +01:00
|
|
|
{
|
2026-02-03 13:55:13 +01:00
|
|
|
id = json.GetLongValue("id");
|
2025-12-18 14:27:27 +01:00
|
|
|
}
|
|
|
|
|
}
|