54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using ServerCore; using ServerBase;
|
|
|
|
namespace ServerCommon
|
|
{
|
|
public class Quest : EntityBase
|
|
{
|
|
private string m_user_guid = string.Empty;
|
|
public Quest(EntityBase parent, string user_guid)
|
|
: base(EntityType.Quest, parent)
|
|
{
|
|
m_user_guid = user_guid;
|
|
onInit().GetAwaiter().GetResult();
|
|
|
|
}
|
|
|
|
public override async Task<Result> onInit()
|
|
{
|
|
addEntityAttributes();
|
|
return await base.onInit();
|
|
}
|
|
|
|
public override string toBasicString()
|
|
{
|
|
return $"{this.getTypeName()} - {getRootParent().toBasicString()}";
|
|
}
|
|
|
|
public override string toSummaryString()
|
|
{
|
|
return $"{this.getTypeName()} - {getRootParent().toBasicString()}";
|
|
}
|
|
|
|
private void addEntityAttributes()
|
|
{
|
|
var parent = getDirectParent();
|
|
NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!!");
|
|
addEntityAttribute(new QuestAttribute(this, parent));
|
|
}
|
|
|
|
public QuestDoc getQuestDoc()
|
|
{
|
|
var attribute = getEntityAttribute<QuestAttribute>();
|
|
NullReferenceCheckHelper.throwIfNull(attribute, () => $"attribute is null !!!");
|
|
var quest_doc = attribute.m_quest_doc_nullable;
|
|
ArgumentNullReferenceCheckHelper.throwIfNull(quest_doc, () => $"quest_doc is null !!!");
|
|
return quest_doc;
|
|
}
|
|
}
|
|
}
|