-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4686f24
commit f3ff5fc
Showing
92 changed files
with
1,143 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections.Generic; | ||
using System.Xml; | ||
using AATool.Data.Objectives; | ||
using AATool.Data.Objectives.Complex; | ||
using AATool.Utilities; | ||
|
||
namespace AATool.Data.Categories | ||
{ | ||
public class AllSmithingTemplates : SingleAdvancement | ||
{ | ||
private const string Id = "custom:all_smithing_templates"; | ||
|
||
public static readonly List<string> SupportedVersions = new () { | ||
"1.20 Snapshot", | ||
}; | ||
|
||
public override IEnumerable<string> GetSupportedVersions() => SupportedVersions; | ||
public override int GetCompletedCount() => this.RecipesObtained; | ||
|
||
public int RecipesObtained { get; private set; } | ||
|
||
public AllSmithingTemplates() : base() | ||
{ | ||
this.Name = "All Smithing Templates"; | ||
this.Acronym = "AST"; | ||
this.Objective = "Templates"; | ||
this.Action = "Obtained"; | ||
} | ||
|
||
public override void LoadObjectives() | ||
{ | ||
Tracker.Advancements.RefreshObjectives(); | ||
Tracker.Advancements.TryGet(Id, out Advancement allSmithingTemplates); | ||
this.Requirement = allSmithingTemplates; | ||
} | ||
|
||
public override void Update() | ||
{ | ||
base.Update(); | ||
RecipesObtained = 0; | ||
if (this.Requirement?.Criteria is not CriteriaSet trims) | ||
return; | ||
|
||
foreach (ArmorTrimCriterion criterion in trims.All.Values) | ||
{ | ||
if (criterion.Obtained) | ||
RecipesObtained++; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Xml; | ||
using AATool.Data.Progress; | ||
using AATool.Utilities; | ||
|
||
namespace AATool.Data.Objectives | ||
{ | ||
internal class ArmorTrimCriterion : Criterion | ||
{ | ||
public string Recipe { get; private set; } | ||
public bool Obtained { get; private set; } | ||
public bool Applied => base.CompletedByDesignated(); | ||
|
||
public override bool CompletedByDesignated() => this.Obtained || base.CompletedByDesignated(); | ||
public override bool IsComplete() => this.Obtained || this.Applied; | ||
|
||
private string plainName; | ||
|
||
public ArmorTrimCriterion(XmlNode node, Advancement advancement) : base(node, advancement) | ||
{ | ||
this.Recipe = XmlObject.Attribute(node, "recipe", string.Empty); | ||
this.plainName = this.Name; | ||
} | ||
|
||
public override void UpdateState(ProgressState progress) | ||
{ | ||
base.UpdateState(progress); | ||
Obtained = progress.Recipes.ContainsKey(this.Recipe); | ||
//this.Name = Applied ? $"{this.plainName} (Applied)" : this.plainName; | ||
//progress.Recipes.TryGetValue(); | ||
} | ||
} | ||
} |
Oops, something went wrong.