using ServerCommon.BusinessLogDomain; using ServerCommon; using META_ID = System.UInt32; namespace GameServer { static public class BeaconShopBusinessLogHelper { static public BeaconShopLogData toLogInfo(BeaconShopMongoDoc beaconShopMongoDoc, bool isActiveSelling) { var logData = new BeaconShopLogData(); logData.setInfo(beaconShopMongoDoc, isActiveSelling); return logData; } static public void setInfo(this BeaconShopLogData logData, BeaconShopMongoDoc beaconShopMongoDoc, bool isActiveSelling) { logData.ItemGuid = beaconShopMongoDoc.ItemGuid; logData.TagId = beaconShopMongoDoc.TagId; logData.BeaconGuid = beaconShopMongoDoc.BeaconGuid; logData.BeaconNickName = beaconShopMongoDoc.BeaconNickName; logData.BeaconTitle = beaconShopMongoDoc.BeaconTitle; logData.BeaconBodyItemMetaId = beaconShopMongoDoc.BeaconBodyItemMetaId; logData.PriceForUnit = beaconShopMongoDoc.PriceForUnit; logData.Amount = beaconShopMongoDoc.Amount; logData.OwnerGuid = beaconShopMongoDoc.OwnerGuid; logData.OwnerNickName = beaconShopMongoDoc.OwnerNickName; logData.BeaconMyHomeGuid = beaconShopMongoDoc.BeaconMyHomeGuid; logData.SellingFinishTime = beaconShopMongoDoc.SellingFinishTime; logData.BuyerGuid = string.Empty; logData.IsActiveSelling = isActiveSelling; } static public BeaconShopLogData toLogInfo(BeaconShopItemAttribute beaconShopItemAttribute, UgcNpcAttribute ugcNpcAttribute, string buyerGuid) { var logData = new BeaconShopLogData(); logData.setInfo(beaconShopItemAttribute, ugcNpcAttribute, buyerGuid); return logData; } static public void setInfo(this BeaconShopLogData logData, BeaconShopItemAttribute beaconShopItemAttribute, UgcNpcAttribute ugcNpcAttribute, string buyerGuid) { logData.ItemGuid = beaconShopItemAttribute.ItemGuid; logData.TagId = (int)beaconShopItemAttribute.ItemMetaId; logData.BeaconGuid = beaconShopItemAttribute.BeaconGuid; logData.BeaconNickName = ugcNpcAttribute.Nickname; logData.BeaconTitle = ugcNpcAttribute.Title; logData.BeaconBodyItemMetaId = (int)ugcNpcAttribute.BodyItemMetaId; logData.PriceForUnit = beaconShopItemAttribute.PriceForUnit; logData.Amount = beaconShopItemAttribute.ItemStackCount; logData.OwnerGuid = beaconShopItemAttribute.UserGuid; logData.BeaconMyHomeGuid = ugcNpcAttribute.LocatedInstanceGuid; logData.SellingFinishTime = beaconShopItemAttribute.SellingFinishTime; logData.BuyerGuid = buyerGuid; logData.IsActiveSelling = beaconShopItemAttribute.IsActiveSelling; } static public BeaconShopSoldRecordLogData toLogInfo(BeaconShopSoldRecordAttribute beaconShopSoldRecordAttribute) { var logData = new BeaconShopSoldRecordLogData(); logData.setInfo(beaconShopSoldRecordAttribute); return logData; } static public void setInfo(this BeaconShopSoldRecordLogData logData, BeaconShopSoldRecordAttribute beaconShopSoldRecordAttribute) { logData.UserGuid = beaconShopSoldRecordAttribute.UserGuid; logData.BeaconGuid = beaconShopSoldRecordAttribute.BeaconGuid; logData.ItemMetaId = beaconShopSoldRecordAttribute.ItemMetaId; logData.BuyerNickName = beaconShopSoldRecordAttribute.BuyerNickName; logData.PriceForUnit = beaconShopSoldRecordAttribute.PriceForUnit; logData.Amount = beaconShopSoldRecordAttribute.Amount; logData.SalesTime = beaconShopSoldRecordAttribute.SalesTime; } static public BeaconShopSoldPriceLogData toLogInfo(string userGuid, string beaconGuid, double deltaPrice, double deltaTaxPrice) { var logData = new BeaconShopSoldPriceLogData(); logData.setInfo(userGuid, beaconGuid, deltaPrice, deltaTaxPrice); return logData; } static public void setInfo(this BeaconShopSoldPriceLogData logData, string userGuid, string beaconGuid, double deltaPrice, double deltaTaxPrice) { logData.UserGuid = userGuid; logData.BeaconGuid = beaconGuid; logData.deltaPrice = deltaPrice; logData.deltaTaxPrice = deltaTaxPrice; } } }