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.
27 lines
532 B
27 lines
532 B
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");
|
|
}
|
|
} |