diff --git a/Winch/Data/POI/Dock/CustomDockPOI.cs b/Winch/Data/POI/Dock/CustomDockPOI.cs index 26431325..2e35f78d 100644 --- a/Winch/Data/POI/Dock/CustomDockPOI.cs +++ b/Winch/Data/POI/Dock/CustomDockPOI.cs @@ -4,7 +4,6 @@ namespace Winch.Data.POI.Dock; -// TODO: actually implement this public class CustomDockPOI : CustomPOI { /// diff --git a/Winch/Serialization/DredgeTypeHelpers.cs b/Winch/Serialization/DredgeTypeHelpers.cs index 38933728..8a5af2a7 100644 --- a/Winch/Serialization/DredgeTypeHelpers.cs +++ b/Winch/Serialization/DredgeTypeHelpers.cs @@ -842,4 +842,28 @@ internal static List ParseCompletedGridConditions(JArray } return parsed; } + + //TODO: implement + internal static QuestStepCondition ParseQuestStepCondition(JToken questStepCondition) => throw new NotImplementedException(); + internal static List ParseQuestStepConditions(JArray o) + { + var parsed = new List(); + foreach (var questStepCondition in o) + { + parsed.Add(ParseQuestStepCondition(questStepCondition)); + } + return parsed; + } + + //TODO: implement + internal static QuestStepEvent ParseQuestStepEvent(JToken questStepEvent) => throw new NotImplementedException(); + internal static List ParseQuestStepEvents(JArray o) + { + var parsed = new List(); + foreach (var questStepEvent in o) + { + parsed.Add(ParseQuestStepEvent(questStepEvent)); + } + return parsed; + } } diff --git a/Winch/Serialization/Quest/Grid/QuestGridConfigConverter.cs b/Winch/Serialization/Quest/Grid/QuestGridConfigConverter.cs index 3aaf57fd..3e489e61 100644 --- a/Winch/Serialization/Quest/Grid/QuestGridConfigConverter.cs +++ b/Winch/Serialization/Quest/Grid/QuestGridConfigConverter.cs @@ -31,7 +31,7 @@ public class QuestGridConfigConverter : DredgeTypeConverter bool.Parse(o.ToString())) }, { "startingDurabilityProportion", new(0f, o=> float.Parse(o.ToString())) }, { "gridConfiguration", new(string.Empty, null) }, - { "presetGrid", new(new SerializableGrid(), o => DredgeTypeHelpers.ParseSerializableGrid(o)) }, //TODO: implement better + { "presetGrid", new(new SerializableGrid(), o => DredgeTypeHelpers.ParseSerializableGrid(o)) }, { "presetGridMode", new(PresetGridMode.NONE, o => DredgeTypeHelpers.GetEnumValue(o)) }, { "completeConditions", new(new List{ new FullCondition() }, o=> DredgeTypeHelpers.ParseCompletedGridConditions((JArray)o)) }, }; diff --git a/Winch/Serialization/Quest/QuestDataConverter.cs b/Winch/Serialization/Quest/QuestDataConverter.cs index a8d1df66..fda70408 100644 --- a/Winch/Serialization/Quest/QuestDataConverter.cs +++ b/Winch/Serialization/Quest/QuestDataConverter.cs @@ -22,7 +22,7 @@ public class QuestDataConverter : DredgeTypeConverter { "steps", new(new List(), o=>DredgeTypeHelpers.ParseStringList((JArray)o)) }, { "subquests", new(new List(), o=>DredgeTypeHelpers.ParseStringList((JArray)o)) }, { "onOfferedQuestStep", new(string.Empty, null) }, - { "offerConditions", new(new List(), null) }, //TODO: implement + { "offerConditions", new(new List(), o=>DredgeTypeHelpers.ParseQuestStepConditions((JArray)o)) }, { "canBeOfferedAutomatically", new(false, o=> bool.Parse(o.ToString())) }, }; diff --git a/Winch/Serialization/Quest/Step/QuestStepDataConverter.cs b/Winch/Serialization/Quest/Step/QuestStepDataConverter.cs index da01abca..b4514a77 100644 --- a/Winch/Serialization/Quest/Step/QuestStepDataConverter.cs +++ b/Winch/Serialization/Quest/Step/QuestStepDataConverter.cs @@ -26,12 +26,12 @@ public class QuestStepDataConverter : DredgeTypeConverter { "showAtSpeaker", new(false, o=> bool.Parse(o.ToString())) }, { "stepSpeaker", new(string.Empty, null) }, { "yarnRootNode", new(string.Empty, null) }, - { "showConditions", new(new List(), null) }, //TODO: implement + { "showConditions", new(new List(), o=>DredgeTypeHelpers.ParseQuestStepConditions((JArray)o)) }, { "canBeFailed", new(false, o=> bool.Parse(o.ToString())) }, - { "failureEvents", new(new List(), null) }, //TODO: implement + { "failureEvents", new(new List(), o=>DredgeTypeHelpers.ParseQuestStepEvents((JArray)o)) }, { "allowAutomaticCompletion", new(false, o=> bool.Parse(o.ToString())) }, { "conditionMode", new(ConditionMode.NULL, o => DredgeTypeHelpers.GetEnumValue(o)) }, - { "completeConditions", new(new List(), null) }, //TODO: implement + { "completeConditions", new(new List(), o=>DredgeTypeHelpers.ParseQuestStepConditions((JArray)o)) }, }; public QuestStepDataConverter()