public bool AddAttachment(ItemUsedEntity itemInfo) { if (_mail.MailAttachment == null) { _mail.MailAttachment = new MailAttachmentEntity(); } if (itemInfo == null) { return(false); } var dicItem = CacheFactory.ItemsdicCache.GetItem(itemInfo.ItemCode); if (dicItem == null) { return(false); } switch (dicItem.ItemType) { case (int)EnumItemType.PlayerCard: _mail.MailAttachment.AddAttachmentUsedItem(EnumAttachmentType.UsedPlayerCard, 1, itemInfo); break; case (int)EnumItemType.Equipment: _mail.MailAttachment.AddAttachmentUsedItem(EnumAttachmentType.UsedEquipment, 1, itemInfo); break; case (int)EnumItemType.MallItem: _mail.MailAttachment.AddAttachmentUsedItem(EnumAttachmentType.UsedMallItem, 1, itemInfo); break; } _mail.HasAttach = true; return(true); }
/// <summary> /// 租借球员装备追回 /// </summary> /// <param name="mailType"></param> /// <param name="managerId"></param> /// <param name="itemInfo"></param> public MailBuilder(EnumMailType mailType, Guid managerId, ItemUsedEntity itemInfo) : this() { //你租借的球员已经到期,球员身上的装备或勋章等被如数追回,请查收附件 string content = ""; AddAttachment(itemInfo); Builder(managerId, mailType, content); }
/// <summary> /// 添加附件,已使用的物品,如拍卖行里的 /// </summary> /// <param name="attachmentType"></param> /// <param name="count"></param> /// <param name="itemInfoEntity"></param> public bool AddAttachmentUsedItem(EnumAttachmentType attachmentType, int count, ItemInfoEntity itemInfoEntity) { ItemUsedEntity usedEntity = null; switch (attachmentType) { case EnumAttachmentType.UsedPlayerCard: usedEntity = new PlayerCardUsedEntity(itemInfoEntity); break; case EnumAttachmentType.UsedEquipment: usedEntity = new EquipmentUsedEntity(itemInfoEntity); break; } if (usedEntity == null) { return(false); } return(AddAttachmentUsedItem(attachmentType, count, usedEntity)); }
public AttachmentUsedItemEntity(int attachmentType, int count, ItemUsedEntity itemUsedEntity) { AttachmentType = attachmentType; Count = count; ItemProperty = itemUsedEntity; }
/// <summary> /// 添加附件,已使用的物品,如拍卖行里的 /// </summary> /// <param name="attachmentType"></param> /// <param name="count"></param> /// <param name="itemUsedEntity"></param> /// <returns></returns> public bool AddAttachmentUsedItem(EnumAttachmentType attachmentType, int count, ItemUsedEntity itemUsedEntity) { var attachment = new AttachmentUsedItemEntity(attachmentType, count); attachment.ItemProperty = itemUsedEntity; Attachments.Add(attachment); return(true); }