초기커밋
This commit is contained in:
72
ServerCommon/Entity/Attribute/UserSocialActionAttribute.cs
Normal file
72
ServerCommon/Entity/Attribute/UserSocialActionAttribute.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user