namespace Yog;
/// An entity a mod declares (`entity Golem { … }`), one object an entity
/// of it: made the first time something happens to it (its constructor
/// subscribes), kept while the server runs, gone when it dies. Its fields
/// are the server's memory (`saved` ones are kept with the entity, they and
/// `synced` ones reach the players who see it).
[Intrinsic]
public abstract class EntityObject {
/// The entity's uuid.
public string Uuid { get; }
/// The world it's in (`minecraft:overworld`).
public string Dimension { get; }
/// It appeared in a world (spawned, or loaded).
public event Action Spawn;
/// It was hurt, by this much.
public event Action<f32> Damage;
/// It died (it's gone after).
public event Action Death;
/// Entity `uuid` as a `T`, on a client: its `saved` and `synced`
/// members as the server sent them to the players who see it (their
/// defaults for one it hasn't); `null` when no mod declares `T`.
[Reified]
public static T? Seen<T>(string uuid) where T : EntityObject;
}