73 lines
2.2 KiB
C#
73 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Numerics;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Linq;
|
|
|
|
|
|
|
|
using ServerCore; using ServerBase;
|
|
|
|
|
|
namespace ServerCommon;
|
|
|
|
public class UserSocialActionAttribute : SocialActionAttributeBase
|
|
{
|
|
public UserSocialActionAttribute(EntityBase owner)
|
|
: base(owner)
|
|
{
|
|
}
|
|
|
|
public override IEntityAttributeTransactor onNewEntityAttributeTransactor()
|
|
{
|
|
var owner = getOwner();
|
|
NullReferenceCheckHelper.throwIfNull(owner, () => $"owner is null !!!");
|
|
var parent = owner.getRootParent();
|
|
NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!! - {owner.toBasicString()}");
|
|
|
|
return new UserSocialActionAttributeTransactor(owner);
|
|
}
|
|
|
|
public override EntityAttributeBase onCloned()
|
|
{
|
|
var owner = getOwner();
|
|
NullReferenceCheckHelper.throwIfNull(owner, () => $"owner is null !!!");
|
|
var parent = owner.getRootParent();
|
|
NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!! - {owner.toBasicString()}");
|
|
|
|
var cloned = new UserSocialActionAttribute(owner);
|
|
|
|
cloned.deepCopyFromBase(this);
|
|
|
|
cloned.SocialActionMetaId = SocialActionMetaId;
|
|
cloned.EquipedPos = EquipedPos;
|
|
|
|
return cloned;
|
|
}
|
|
|
|
public override DynamoDbDocBase onCreateDocBase()
|
|
{
|
|
var owner = getOwner();
|
|
NullReferenceCheckHelper.throwIfNull(owner, () => $"owner is null !!!");
|
|
var parent = owner.getRootParent();
|
|
NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!! - {owner.toBasicString()}");
|
|
|
|
var user_attribute = parent.getEntityAttribute<UserAttribute>();
|
|
NullReferenceCheckHelper.throwIfNull(user_attribute, () => $"user_attribute is null !!! - {owner.toBasicString()}");
|
|
|
|
var user_guid = user_attribute.UserGuid;
|
|
|
|
return new SocialActionDoc(OwnerEntityType.User, user_guid, SocialActionMetaId);
|
|
}
|
|
}
|
|
|
|
public class UserSocialActionAttributeTransactor : SocialActionAttributeBaseTransactor<UserSocialActionAttribute>
|
|
{
|
|
public UserSocialActionAttributeTransactor(EntityBase owner)
|
|
: base(owner)
|
|
{
|
|
}
|
|
}
|