net.dreditor.progressing.handling 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/.attestation.p7m +0 -0
  2. package/ChapterTitleDisplayer.cs +41 -41
  3. package/ChapterTitleDisplayer.cs.meta +11 -11
  4. package/DREditor.Progressing.Handling.asmdef +16 -16
  5. package/DREditor.Progressing.Handling.asmdef.meta +7 -7
  6. package/FlagTriggerExtensions.cs +78 -78
  7. package/FlagTriggerExtensions.cs.meta +11 -11
  8. package/FlagTriggerHandler.cs +236 -236
  9. package/FlagTriggerHandler.cs.meta +11 -11
  10. package/FlagTriggerHandlerBase.cs +65 -65
  11. package/FlagTriggerHandlerBase.cs.meta +11 -11
  12. package/HistoricalManagerBase.cs +158 -158
  13. package/HistoricalManagerBase.cs.meta +1 -1
  14. package/IHistory.cs +100 -100
  15. package/IHistory.cs.meta +1 -1
  16. package/ProgressionData.cs +180 -180
  17. package/ProgressionData.cs.meta +11 -11
  18. package/ProgressionDebugger.cs +185 -185
  19. package/ProgressionDebugger.cs.meta +11 -11
  20. package/ProgressionFlagHandler.cs +166 -166
  21. package/ProgressionFlagHandler.cs.meta +11 -11
  22. package/ProgressionHistoryManager.cs +33 -33
  23. package/ProgressionHistoryManager.cs.meta +11 -11
  24. package/ProgressionInfo.cs +53 -53
  25. package/ProgressionInfo.cs.meta +11 -11
  26. package/ProgressionLoader.cs +128 -128
  27. package/ProgressionLoader.cs.meta +11 -11
  28. package/ProgressionManager.cs +285 -285
  29. package/ProgressionManager.cs.meta +11 -11
  30. package/ProgressionManagerBase.cs +131 -131
  31. package/ProgressionManagerBase.cs.meta +11 -11
  32. package/ProgressionSaver.cs +48 -48
  33. package/ProgressionSaver.cs.meta +11 -11
  34. package/{Samples → Samples~}/CurrentChapterIndex.asset +21 -21
  35. package/{Samples → Samples~}/CurrentChapterIndex.asset.meta +8 -8
  36. package/{Samples → Samples~}/CurrentObjectiveIndex.asset +19 -19
  37. package/{Samples → Samples~}/CurrentObjectiveIndex.asset.meta +8 -8
  38. package/{Samples → Samples~}/CurrentObjectiveName.asset +19 -19
  39. package/{Samples → Samples~}/CurrentObjectiveName.asset.meta +8 -8
  40. package/{Samples → Samples~}/FlagTriggered.asset +19 -19
  41. package/{Samples → Samples~}/FlagTriggered.asset.meta +8 -8
  42. package/{Samples → Samples~}/Flag_Trigger_Handler.prefab +194 -194
  43. package/{Samples → Samples~}/Flag_Trigger_Handler.prefab.meta +7 -7
  44. package/{Samples → Samples~}/LoadProgressionData.asset +14 -14
  45. package/{Samples → Samples~}/LoadProgressionData.asset.meta +8 -8
  46. package/{Samples → Samples~}/MoveToNextNaturalObjective.asset +14 -14
  47. package/{Samples → Samples~}/MoveToNextNaturalObjective.asset.meta +8 -8
  48. package/{Samples → Samples~}/MoveToObjective.asset +19 -19
  49. package/{Samples → Samples~}/MoveToObjective.asset.meta +8 -8
  50. package/{Samples → Samples~}/ObjectiveKeepsInstanceData.asset +19 -19
  51. package/{Samples → Samples~}/ObjectiveKeepsInstanceData.asset.meta +8 -8
  52. package/{Samples → Samples~}/OnGeneratePastData.asset +14 -14
  53. package/{Samples → Samples~}/OnGeneratePastData.asset.meta +8 -8
  54. package/{Samples → Samples~}/OnLastObjective.asset +19 -19
  55. package/{Samples → Samples~}/OnLastObjective.asset.meta +8 -8
  56. package/{Samples → Samples~}/Progression_Debugger.prefab +73 -73
  57. package/{Samples → Samples~}/Progression_Debugger.prefab.meta +7 -7
  58. package/{Samples → Samples~}/Progression_Flag_Handler.prefab +47 -47
  59. package/{Samples → Samples~}/Progression_Flag_Handler.prefab.meta +7 -7
  60. package/{Samples → Samples~}/Progression_History_Manager.prefab +107 -107
  61. package/{Samples → Samples~}/Progression_History_Manager.prefab.meta +7 -7
  62. package/{Samples → Samples~}/Progression_Loader.prefab +76 -76
  63. package/{Samples → Samples~}/Progression_Loader.prefab.meta +7 -7
  64. package/{Samples → Samples~}/Progression_Manager_ETemplate.prefab +603 -603
  65. package/{Samples → Samples~}/Progression_Manager_ETemplate.prefab.meta +7 -7
  66. package/{Samples → Samples~}/Progression_Saver.prefab +51 -51
  67. package/{Samples → Samples~}/Progression_Saver.prefab.meta +7 -7
  68. package/{Samples → Samples~}/RequiredFlagsTriggered.asset +19 -19
  69. package/{Samples → Samples~}/RequiredFlagsTriggered.asset.meta +8 -8
  70. package/{Samples → Samples~}/TriggerAllRequiredFlags.asset +14 -14
  71. package/{Samples → Samples~}/TriggerAllRequiredFlags.asset.meta +8 -8
  72. package/package.json +40 -35
  73. package/package.json.meta +7 -7
  74. package/Samples.meta +0 -8
@@ -1,167 +1,167 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Services;
3
- using System.Collections.Generic;
4
- using UnityEngine;
5
- using UnityEngine.Scripting.APIUpdating;
6
- using UnityEngine.Serialization;
7
-
8
- namespace DREditor.Progressing.Handling
9
- {
10
- /// <summary>
11
- ///
12
- /// </summary>
13
- [ClassHeader("")]
14
- [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
15
- public class ProgressionFlagHandler : MonoBehaviour
16
- {
17
- /// <summary>
18
- ///
19
- /// </summary>
20
- [Tooltip("")]
21
- [FormerlySerializedAs("database")]
22
- [SerializeField] protected ProgressionDatabase progressionDatabase = null;
23
-
24
-
25
- /// <summary>
26
- ///
27
- /// </summary>
28
- /// <param name="flagName"></param>
29
- /// <param name="targetObjective"></param>
30
- /// <returns></returns>
31
- public virtual ProgressionFlag GetFlag(string flagName, Objective targetObjective)
32
- {
33
- if (SearchCurrentObjective(flagName, targetObjective) is ProgressionFlag flagOne && flagOne != null)
34
- return flagOne;
35
-
36
-
37
- RepairProgressionHistory(ServiceLocator.GetService<IHistory>().GetChapterHistory());
38
-
39
- if (ServiceLocator.GetService<IHistory>().GetFlagFromHistory(flagName) is ProgressionFlag flagTwo && flagTwo != null)
40
- return flagTwo;
41
-
42
-
43
- RepairObjective(ref targetObjective);
44
-
45
- if (SearchCurrentObjective(flagName, targetObjective) is ProgressionFlag flagThree && flagThree != null)
46
- return flagThree;
47
-
48
-
49
- return OnFlagNotRevived(flagName);
50
- }
51
-
52
- /// <summary>
53
- ///
54
- /// </summary>
55
- /// <param name="chapterHistory"></param>
56
- protected virtual void RepairProgressionHistory(List<List<Objective>> chapterHistory)
57
- {
58
- UnityEngine.Debug.Log($"REPORT: {ToString()}: Repairing progression history.");
59
-
60
- foreach (List<Objective> chapterObjectives in chapterHistory)
61
- RepairObjectivesOnFlagMismatch(chapterObjectives);
62
-
63
- ServiceLocator.GetService<IHistory>().SetChapterHistory(chapterHistory);
64
- }
65
-
66
- /// <summary>
67
- ///
68
- /// </summary>
69
- /// <param name="objectives"></param>
70
- protected virtual void RepairObjectivesOnFlagMismatch(List<Objective> objectives)
71
- {
72
- for (int i = 0; i < objectives.Count; i++)
73
- RepairObjectiveOnFlagMismatch(objectives[i]);
74
- }
75
-
76
- /// <summary>
77
- ///
78
- /// </summary>
79
- /// <param name="objective"></param>
80
- protected virtual void RepairObjectiveOnFlagMismatch(Objective objective)
81
- {
82
- if (ObjectiveFlagsDontMatchBase(objective))
83
- RepairObjective(ref objective);
84
- }
85
-
86
- /// <summary>
87
- ///
88
- /// </summary>
89
- /// <param name="objective"></param>
90
- /// <returns></returns>
91
- protected virtual bool ObjectiveFlagsDontMatchBase(Objective objective)
92
- => objective.Flags.Count != progressionDatabase.GetObjective(objective.Description).Flags.Count;
93
-
94
- /// <summary>
95
- ///
96
- /// </summary>
97
- /// <param name="flagName"></param>
98
- /// <returns></returns>
99
- protected virtual ProgressionFlag OnFlagNotRevived(string flagName)
100
- {
101
- UnityEngine.Debug.LogWarning("ALERT: After repairing the current save file objective, the current " +
102
- "flag couldn't be found. Best to contact Sweden for support.");
103
-
104
- UnityEngine.Debug.LogWarning("ALERT: Since the flag couldn't be found for Flag: " + flagName +
105
- " the game will just return a triggered flag and use that as the default.");
106
-
107
- return new ProgressionFlag(true);
108
- }
109
-
110
- /// <summary>
111
- ///
112
- /// </summary>
113
- /// <param name="objective"></param>
114
- public virtual void RepairObjective(ref Objective objective)
115
- {
116
- UnityEngine.Debug.LogWarning("REPORT: The system noticed an issue with the current objective and will now repair it." +
117
- "\nThis is common in scenarios where objective data from a save file is outdated or manipulated through debugging.");
118
-
119
- Objective currentObjectiveCopy = (Objective)objective.Clone();
120
-
121
- objective = (Objective)progressionDatabase.GetObjective(objective.Description).Clone();
122
-
123
- CopyFlagsToObjective(currentObjectiveCopy, ref objective);
124
- }
125
-
126
- /// <summary>
127
- ///
128
- /// </summary>
129
- /// <param name="currentObjectiveCopy"></param>
130
- /// <param name="targetObjective"></param>
131
- protected virtual void CopyFlagsToObjective(Objective currentObjectiveCopy, ref Objective targetObjective)
132
- {
133
- for (int i = 0; i < currentObjectiveCopy.Flags.Count; i++)
134
- ApplyFlagStateToObjectivesFlag(currentObjectiveCopy.Flags[i], ref targetObjective);
135
- }
136
-
137
- /// <summary>
138
- ///
139
- /// </summary>
140
- /// <param name="originalFlag"></param>
141
- /// <param name="targetObjective"></param>
142
- protected virtual void ApplyFlagStateToObjectivesFlag(ProgressionFlag originalFlag, ref Objective targetObjective)
143
- {
144
- foreach (ProgressionFlag currentObjectiveFlag in targetObjective.Flags)
145
- if (currentObjectiveFlag.name == originalFlag.name && originalFlag.triggered)
146
- currentObjectiveFlag.SetTriggered(true);
147
- }
148
-
149
- /// <summary>
150
- ///
151
- /// </summary>
152
- /// <param name="flagName"></param>
153
- /// <param name="currentObjective"></param>
154
- /// <returns></returns>
155
- protected virtual ProgressionFlag SearchCurrentObjective(string flagName, Objective currentObjective)
156
- {
157
- foreach (ProgressionFlag flag in currentObjective.Flags)
158
- if (flag.name == flagName)
159
- return flag;
160
-
161
- UnityEngine.Debug.LogWarning("ALERT: Flag: " + flagName + " could not be found on Objective: " +
162
- currentObjective.Description + " Make sure you spell the flag name correctly!");
163
-
164
- return null;
165
- }
166
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Services;
3
+ using System.Collections.Generic;
4
+ using UnityEngine;
5
+ using UnityEngine.Scripting.APIUpdating;
6
+ using UnityEngine.Serialization;
7
+
8
+ namespace DREditor.Progressing.Handling
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ [ClassHeader("")]
14
+ [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
15
+ public class ProgressionFlagHandler : MonoBehaviour
16
+ {
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ [Tooltip("")]
21
+ [FormerlySerializedAs("database")]
22
+ [SerializeField] protected ProgressionDatabase progressionDatabase = null;
23
+
24
+
25
+ /// <summary>
26
+ ///
27
+ /// </summary>
28
+ /// <param name="flagName"></param>
29
+ /// <param name="targetObjective"></param>
30
+ /// <returns></returns>
31
+ public virtual ProgressionFlag GetFlag(string flagName, Objective targetObjective)
32
+ {
33
+ if (SearchCurrentObjective(flagName, targetObjective) is ProgressionFlag flagOne && flagOne != null)
34
+ return flagOne;
35
+
36
+
37
+ RepairProgressionHistory(ServiceLocator.GetService<IHistory>().GetChapterHistory());
38
+
39
+ if (ServiceLocator.GetService<IHistory>().GetFlagFromHistory(flagName) is ProgressionFlag flagTwo && flagTwo != null)
40
+ return flagTwo;
41
+
42
+
43
+ RepairObjective(ref targetObjective);
44
+
45
+ if (SearchCurrentObjective(flagName, targetObjective) is ProgressionFlag flagThree && flagThree != null)
46
+ return flagThree;
47
+
48
+
49
+ return OnFlagNotRevived(flagName);
50
+ }
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ /// <param name="chapterHistory"></param>
56
+ protected virtual void RepairProgressionHistory(List<List<Objective>> chapterHistory)
57
+ {
58
+ UnityEngine.Debug.Log($"REPORT: {ToString()}: Repairing progression history.");
59
+
60
+ foreach (List<Objective> chapterObjectives in chapterHistory)
61
+ RepairObjectivesOnFlagMismatch(chapterObjectives);
62
+
63
+ ServiceLocator.GetService<IHistory>().SetChapterHistory(chapterHistory);
64
+ }
65
+
66
+ /// <summary>
67
+ ///
68
+ /// </summary>
69
+ /// <param name="objectives"></param>
70
+ protected virtual void RepairObjectivesOnFlagMismatch(List<Objective> objectives)
71
+ {
72
+ for (int i = 0; i < objectives.Count; i++)
73
+ RepairObjectiveOnFlagMismatch(objectives[i]);
74
+ }
75
+
76
+ /// <summary>
77
+ ///
78
+ /// </summary>
79
+ /// <param name="objective"></param>
80
+ protected virtual void RepairObjectiveOnFlagMismatch(Objective objective)
81
+ {
82
+ if (ObjectiveFlagsDontMatchBase(objective))
83
+ RepairObjective(ref objective);
84
+ }
85
+
86
+ /// <summary>
87
+ ///
88
+ /// </summary>
89
+ /// <param name="objective"></param>
90
+ /// <returns></returns>
91
+ protected virtual bool ObjectiveFlagsDontMatchBase(Objective objective)
92
+ => objective.Flags.Count != progressionDatabase.GetObjective(objective.Description).Flags.Count;
93
+
94
+ /// <summary>
95
+ ///
96
+ /// </summary>
97
+ /// <param name="flagName"></param>
98
+ /// <returns></returns>
99
+ protected virtual ProgressionFlag OnFlagNotRevived(string flagName)
100
+ {
101
+ UnityEngine.Debug.LogWarning("ALERT: After repairing the current save file objective, the current " +
102
+ "flag couldn't be found. Best to contact Sweden for support.");
103
+
104
+ UnityEngine.Debug.LogWarning("ALERT: Since the flag couldn't be found for Flag: " + flagName +
105
+ " the game will just return a triggered flag and use that as the default.");
106
+
107
+ return new ProgressionFlag(true);
108
+ }
109
+
110
+ /// <summary>
111
+ ///
112
+ /// </summary>
113
+ /// <param name="objective"></param>
114
+ public virtual void RepairObjective(ref Objective objective)
115
+ {
116
+ UnityEngine.Debug.LogWarning("REPORT: The system noticed an issue with the current objective and will now repair it." +
117
+ "\nThis is common in scenarios where objective data from a save file is outdated or manipulated through debugging.");
118
+
119
+ Objective currentObjectiveCopy = (Objective)objective.Clone();
120
+
121
+ objective = (Objective)progressionDatabase.GetObjective(objective.Description).Clone();
122
+
123
+ CopyFlagsToObjective(currentObjectiveCopy, ref objective);
124
+ }
125
+
126
+ /// <summary>
127
+ ///
128
+ /// </summary>
129
+ /// <param name="currentObjectiveCopy"></param>
130
+ /// <param name="targetObjective"></param>
131
+ protected virtual void CopyFlagsToObjective(Objective currentObjectiveCopy, ref Objective targetObjective)
132
+ {
133
+ for (int i = 0; i < currentObjectiveCopy.Flags.Count; i++)
134
+ ApplyFlagStateToObjectivesFlag(currentObjectiveCopy.Flags[i], ref targetObjective);
135
+ }
136
+
137
+ /// <summary>
138
+ ///
139
+ /// </summary>
140
+ /// <param name="originalFlag"></param>
141
+ /// <param name="targetObjective"></param>
142
+ protected virtual void ApplyFlagStateToObjectivesFlag(ProgressionFlag originalFlag, ref Objective targetObjective)
143
+ {
144
+ foreach (ProgressionFlag currentObjectiveFlag in targetObjective.Flags)
145
+ if (currentObjectiveFlag.name == originalFlag.name && originalFlag.triggered)
146
+ currentObjectiveFlag.SetTriggered(true);
147
+ }
148
+
149
+ /// <summary>
150
+ ///
151
+ /// </summary>
152
+ /// <param name="flagName"></param>
153
+ /// <param name="currentObjective"></param>
154
+ /// <returns></returns>
155
+ protected virtual ProgressionFlag SearchCurrentObjective(string flagName, Objective currentObjective)
156
+ {
157
+ foreach (ProgressionFlag flag in currentObjective.Flags)
158
+ if (flag.name == flagName)
159
+ return flag;
160
+
161
+ UnityEngine.Debug.LogWarning("ALERT: Flag: " + flagName + " could not be found on Objective: " +
162
+ currentObjective.Description + " Make sure you spell the flag name correctly!");
163
+
164
+ return null;
165
+ }
166
+ }
167
167
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: bcf0ed5e4f754c141b29b31b35016f13
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: bcf0ed5e4f754c141b29b31b35016f13
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,34 +1,34 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.EventObjects;
3
- using DREditor.Saving;
4
- using UnityEngine;
5
- using UnityEngine.Scripting.APIUpdating;
6
-
7
- namespace DREditor.Progressing.Handling
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [ClassHeader(nameof(HistoricalManagerBase<IHistory, ProgressionHistoryManager>) + " SERVICE for type: " + nameof(IHistory) +
13
- "\n" + nameof(IDRESaveable) + ", " + nameof(IDRELoadableManager) + ", " +
14
- nameof(IDRELoadable) + ", " + nameof(ILoadOnChapterSelect) +
15
- "\n\n")]
16
- [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
17
- public class ProgressionHistoryManager : HistoricalManagerBase<IHistory, ProgressionHistoryManager>
18
- {
19
- /// <summary>
20
- ///
21
- /// </summary>
22
- [Tooltip("")]
23
- [SerializeField] protected IntWithEvent currentChapterIndex = null;
24
-
25
-
26
- /// <inheritdoc/>
27
- protected override object GetInstanceData()
28
- {
29
- historicalData.SetChapterIndex(currentChapterIndex.Value);
30
-
31
- return base.GetInstanceData();
32
- }
33
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.EventObjects;
3
+ using DREditor.Saving;
4
+ using UnityEngine;
5
+ using UnityEngine.Scripting.APIUpdating;
6
+
7
+ namespace DREditor.Progressing.Handling
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [ClassHeader(nameof(HistoricalManagerBase<IHistory, ProgressionHistoryManager>) + " SERVICE for type: " + nameof(IHistory) +
13
+ "\n" + nameof(IDRESaveable) + ", " + nameof(IDRELoadableManager) + ", " +
14
+ nameof(IDRELoadable) + ", " + nameof(ILoadOnChapterSelect) +
15
+ "\n\n")]
16
+ [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
17
+ public class ProgressionHistoryManager : HistoricalManagerBase<IHistory, ProgressionHistoryManager>
18
+ {
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ [Tooltip("")]
23
+ [SerializeField] protected IntWithEvent currentChapterIndex = null;
24
+
25
+
26
+ /// <inheritdoc/>
27
+ protected override object GetInstanceData()
28
+ {
29
+ historicalData.SetChapterIndex(currentChapterIndex.Value);
30
+
31
+ return base.GetInstanceData();
32
+ }
33
+ }
34
34
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 6a63ff1dbb51fd34fa4e1eb6822643bd
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 6a63ff1dbb51fd34fa4e1eb6822643bd
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,54 +1,54 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using System.Collections.Generic;
3
- using UnityEngine;
4
- using UnityEngine.Scripting.APIUpdating;
5
-
6
- namespace DREditor.Progressing.Handling
7
- {
8
- /// <summary>
9
- ///
10
- /// </summary>
11
- [System.Serializable]
12
- [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
13
- public class ProgressionInfo
14
- {
15
- /// <summary>
16
- ///
17
- /// </summary>
18
- [Tooltip("")]
19
- public List<Objective> objectives = new();
20
-
21
-
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- /// <param name="objectives"></param>
26
- public virtual void SetObjectiveHistory(List<Objective> objectives) => this.objectives = objectives;
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- /// <param name="objective"></param>
32
- public virtual void Add(Objective objective)
33
- {
34
- if (ContainsObjective(objective.Description))
35
- return;
36
-
37
- objectives.Add(objective);
38
- }
39
-
40
- /// <summary>
41
- ///
42
- /// </summary>
43
- /// <param name="objectiveName"></param>
44
- /// <returns></returns>
45
- public virtual bool ContainsObjective(string objectiveName)
46
- {
47
- for (int i = 0; i < objectives.Count; i++)
48
- if (objectives[i].Description == objectiveName)
49
- return true;
50
-
51
- return false;
52
- }
53
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using System.Collections.Generic;
3
+ using UnityEngine;
4
+ using UnityEngine.Scripting.APIUpdating;
5
+
6
+ namespace DREditor.Progressing.Handling
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ [System.Serializable]
12
+ [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
13
+ public class ProgressionInfo
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [Tooltip("")]
19
+ public List<Objective> objectives = new();
20
+
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ /// <param name="objectives"></param>
26
+ public virtual void SetObjectiveHistory(List<Objective> objectives) => this.objectives = objectives;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ /// <param name="objective"></param>
32
+ public virtual void Add(Objective objective)
33
+ {
34
+ if (ContainsObjective(objective.Description))
35
+ return;
36
+
37
+ objectives.Add(objective);
38
+ }
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ /// <param name="objectiveName"></param>
44
+ /// <returns></returns>
45
+ public virtual bool ContainsObjective(string objectiveName)
46
+ {
47
+ for (int i = 0; i < objectives.Count; i++)
48
+ if (objectives[i].Description == objectiveName)
49
+ return true;
50
+
51
+ return false;
52
+ }
53
+ }
54
54
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 1b71777b6ad24074aa85f533f150c712
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 1b71777b6ad24074aa85f533f150c712
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: