You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
546 B
23 lines
546 B
using Babushka.scripts.CSharp.GameEntity.LoadSave;
|
|
using Babushka.scripts.CSharp.GameEntity.Types;
|
|
using Godot;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
namespace Babushka.scripts.CSharp.GameEntity.Entities;
|
|
|
|
public partial class Entity : Node2D
|
|
{
|
|
private long _id;
|
|
protected virtual EntityType Type => EntityType.None;
|
|
|
|
protected virtual void SaveEntity(JObject json)
|
|
{
|
|
json["id"] = _id;
|
|
json["type"] = (int)Type;
|
|
}
|
|
|
|
protected virtual void LoadEntity(JObject json)
|
|
{
|
|
_id = json.GetLongValue("id");
|
|
}
|
|
} |