27 lines
532 B
C#
27 lines
532 B
C#
using System;
|
|
using Babushka.scripts.CSharp.GameEntity.LoadSave;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
namespace Babushka.scripts.CSharp.GameEntity.Entities;
|
|
|
|
public class Entity
|
|
{
|
|
public long id;
|
|
public virtual string EntityType => "";
|
|
|
|
public Entity()
|
|
{
|
|
id = new Random().NextInt64();
|
|
}
|
|
|
|
public virtual void SaveEntity(JObject json)
|
|
{
|
|
json["id"] = id;
|
|
json["type"] = EntityType;
|
|
}
|
|
|
|
public virtual void LoadEntity(JObject json)
|
|
{
|
|
id = json.GetLongValue("id");
|
|
}
|
|
} |