2024-02-10 16:04:03 +00:00
|
|
|
|
using GameServer.Systems.Entity.Component;
|
|
|
|
|
using Protocol;
|
|
|
|
|
|
|
|
|
|
namespace GameServer.Systems.Entity;
|
|
|
|
|
internal abstract class EntityBase
|
|
|
|
|
{
|
|
|
|
|
public long Id { get; }
|
|
|
|
|
public EntityComponentSystem ComponentSystem { get; }
|
|
|
|
|
|
|
|
|
|
public Vector Pos { get; set; }
|
|
|
|
|
public Rotator Rot { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool Active { get; set; }
|
|
|
|
|
|
|
|
|
|
public EntityState State { get; protected set; }
|
|
|
|
|
|
|
|
|
|
public EntityBase(long id)
|
|
|
|
|
{
|
|
|
|
|
Id = id;
|
|
|
|
|
|
|
|
|
|
Pos = new Vector();
|
|
|
|
|
Rot = new Rotator();
|
|
|
|
|
|
|
|
|
|
ComponentSystem = new EntityComponentSystem();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void OnCreate()
|
|
|
|
|
{
|
|
|
|
|
State = EntityState.Born;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-10 22:28:35 +00:00
|
|
|
|
public virtual void Activate()
|
2024-02-10 16:04:03 +00:00
|
|
|
|
{
|
2024-02-10 22:28:35 +00:00
|
|
|
|
// Activate.
|
2024-02-10 16:04:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual LivingStatus LivingStatus => LivingStatus.Alive;
|
|
|
|
|
public virtual bool IsVisible => true;
|
|
|
|
|
|
|
|
|
|
public abstract EEntityType Type { get; }
|
|
|
|
|
public abstract EntityConfigType ConfigType { get; }
|
|
|
|
|
|
|
|
|
|
public abstract EntityPb Pb { get; }
|
|
|
|
|
}
|