초기커밋
This commit is contained in:
38
GameServer/Contents/OwnedBuilding/OwnedBuilding.cs
Normal file
38
GameServer/Contents/OwnedBuilding/OwnedBuilding.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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 OwnedBuilding : EntityBase
|
||||
{
|
||||
public OwnedBuilding(Player parent)
|
||||
: base(EntityType.OwnedBuilding, parent)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
var parent = getDirectParent();
|
||||
NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!!");
|
||||
addEntityAttribute(new OwnedBuildingAttribute(this, parent));
|
||||
addEntityAction(new OwnedBuildingAction(this));
|
||||
|
||||
return await base.onInit();
|
||||
}
|
||||
|
||||
public override string toBasicString()
|
||||
{
|
||||
return $"{this.getTypeName()}, BuildingMetaId:{getOriginEntityAttribute<OwnedBuildingAttribute>()?.BuildingMetaId}";
|
||||
}
|
||||
|
||||
public override string toSummaryString()
|
||||
{
|
||||
return $"{this.getTypeName()}, {getEntityAttribute<OwnedBuildingAttribute>()?.toBasicString()}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user