63 lines
1.8 KiB
C#
63 lines
1.8 KiB
C#
using Newtonsoft.Json;
|
|
|
|
using ServerBase;
|
|
|
|
namespace ServerCommon.BusinessLogDomain;
|
|
|
|
public class UseRewardPropInfo : ILogInvoker.IInfo
|
|
{
|
|
[JsonProperty("AnchorGuid")]
|
|
public string m_anchor_guid { get; set; } = string.Empty;
|
|
[JsonProperty("AnchorPropTableId")]
|
|
public int m_anchor_prop_table_id { get; set; } = 0;
|
|
[JsonProperty("UsedReward")]
|
|
public int m_used_reward { get; set; } = 0;
|
|
[JsonProperty("Rewards")]
|
|
public List<MetaAssets.Reward> m_rewards { get; set; } = new();
|
|
|
|
public UseRewardPropInfo(string guid, int tableId, int usedReward, List<MetaAssets.RewardMetaData> rewards) : base()
|
|
{
|
|
m_anchor_guid = guid;
|
|
m_anchor_prop_table_id = tableId;
|
|
m_used_reward = usedReward;
|
|
m_rewards = new();
|
|
foreach (var reward in rewards)
|
|
{
|
|
m_rewards.Add(reward.Reward);
|
|
}
|
|
}
|
|
|
|
public UseRewardPropInfo(ILogInvoker parent, UseRewardPropInfo info) : base(parent)
|
|
{
|
|
if (null != info)
|
|
{
|
|
setUseRewardPropInfo(info);
|
|
}
|
|
}
|
|
|
|
public void setUseRewardPropInfo(UseRewardPropInfo logInfo)
|
|
{
|
|
m_anchor_guid = logInfo.m_anchor_guid;
|
|
m_anchor_prop_table_id = logInfo.m_anchor_prop_table_id;
|
|
m_used_reward = logInfo.m_used_reward;
|
|
m_rewards = new();
|
|
m_rewards.AddRange(logInfo.m_rewards);
|
|
}
|
|
}
|
|
|
|
public struct PropRewardInfo
|
|
{
|
|
[JsonProperty("Type")]
|
|
public ERewardType m_reward_type { get; private set; } = ERewardType.none;
|
|
[JsonProperty("Id")]
|
|
public int m_reward_type_id { get; private set; } = 0;
|
|
[JsonProperty("Value")]
|
|
public long m_reward_type_value { get; private set; } = 0;
|
|
public PropRewardInfo(ERewardType type, int id, long value)
|
|
{
|
|
m_reward_type = type;
|
|
m_reward_type_id = id;
|
|
m_reward_type_value = value;
|
|
}
|
|
}
|