초기커밋
This commit is contained in:
48
GameServer/Entity/CustomDefinedUi/CustomDefinedUi.cs
Normal file
48
GameServer/Entity/CustomDefinedUi/CustomDefinedUi.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class CustomDefinedUi : EntityBase
|
||||
{
|
||||
public CustomDefinedUi(EntityBase parent)
|
||||
: base(EntityType.CustomDefinedUi, parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
var parent = getDirectParent();
|
||||
NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!!");
|
||||
|
||||
addEntityAttribute(new CustomDefinedUiAttribute(this, parent));
|
||||
|
||||
return await base.onInit();
|
||||
}
|
||||
|
||||
public override string toBasicString()
|
||||
{
|
||||
var custom_defined_ui_attribute = getOriginEntityAttribute<CustomDefinedUiAttribute>();
|
||||
NullReferenceCheckHelper.throwIfNull(custom_defined_ui_attribute, () => $"custom_defined_ui_attribute is null !!!");
|
||||
|
||||
return $"{this.getTypeName()}, UIKey:{custom_defined_ui_attribute.UiKey}, UILength:{custom_defined_ui_attribute.CustomDefinedUi.Length}";
|
||||
}
|
||||
|
||||
public override string toSummaryString()
|
||||
{
|
||||
var custom_defined_ui_attribute = getOriginEntityAttribute<CustomDefinedUiAttribute>();
|
||||
NullReferenceCheckHelper.throwIfNull(custom_defined_ui_attribute, () => $"custom_defined_ui_attribute is null !!!");
|
||||
|
||||
return $"{this.getTypeName()}, {custom_defined_ui_attribute.toBasicString()}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user