Files
2025-05-01 07:20:41 +09:00

39 lines
1.1 KiB
C#

using ServerCommon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ServerCore; using ServerBase;
namespace GameServer
{
public class OwnedLand : EntityBase
{
public OwnedLand(Player parent)
: base(EntityType.OwnedLand, parent)
{
}
public override async Task<Result> onInit()
{
var parent = getDirectParent();
NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!!");
addEntityAttribute(new OwnedLandAttribute(this, parent));
addEntityAction(new OwnedLandAction(this));
return await base.onInit();
}
public override string toBasicString()
{
return $"{this.getTypeName()}, LandMetaId:{getOriginEntityAttribute<OwnedLandAttribute>()?.LandMetaId}";
}
public override string toSummaryString()
{
return $"{this.getTypeName()}, {getEntityAttribute<OwnedLandAttribute>()?.toBasicString()}";
}
}
}