Пример #1
0
 private static void AssignTo(this QuestReward questReward, Network.Packets.ServerToClient.QuestReward rewardStruct, IItemSerializer itemSerializer)
 {
     rewardStruct.Type        = questReward.RewardType.Convert();
     rewardStruct.RewardCount = (uint)questReward.Value;
     if (questReward.RewardType == QuestRewardType.Item && questReward.ItemReward is { } itemReward)
     {
         rewardStruct.RewardId = itemReward.Definition.GetItemType();
         itemSerializer.SerializeItem(rewardStruct.RewardedItemData, itemReward);
     }
 }
Пример #2
0
 public void SerializeItem(T item, Span <byte> buffer) => _typedSerializer.SerializeItem(item, buffer);