rft: wpf生息演算任务序列化

This commit is contained in:
status102
2025-03-02 11:51:19 +08:00
parent 0a2d2970f6
commit 564f9e5dce
2 changed files with 84 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ using System.Collections.Generic;
using System.Linq;
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Models.AsstTasks;
using MaaWpfGui.Services;
using MaaWpfGui.Utilities.ValueType;
using MaaWpfGui.ViewModels.UI;
@@ -158,14 +159,13 @@ public class ReclamationSettingsUserControlModel : TaskViewModel
/// <returns>返回(Asst任务类型, 参数)</returns>
public override (AsstTaskType Type, JObject Params) Serialize()
{
var data = new JObject
return new AsstReclamationTask()
{
["theme"] = ReclamationTheme,
["mode"] = ReclamationMode,
["increment_mode"] = ReclamationIncrementMode,
["num_craft_batches"] = ReclamationMaxCraftCountPerRound,
["tools_to_craft"] = new JArray(ReclamationToolToCraft.Split(';').Select(s => s.Trim())),
};
return (AsstTaskType.Reclamation, data);
Theme = ReclamationTheme,
Mode = ReclamationMode,
IncrementMode = ReclamationIncrementMode,
MaxCraftCountPerRound = ReclamationMaxCraftCountPerRound,
ToolToCraft = ReclamationToolToCraft.Split(';').Select(s => s.Trim()).ToList(),
}.Serialize();
}
}