mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 13:16:35 -05:00
fix all formatting issues
This commit is contained in:
@@ -785,7 +785,7 @@ namespace HavenSoft.HexManiac.Core.Models {
|
||||
} else {
|
||||
var childNames = run.ElementNames;
|
||||
if (childNames != null && childNames.Count > 0) {
|
||||
foreach(var childName in childNames) {
|
||||
foreach (var childName in childNames) {
|
||||
var full = $"{name}{ArrayAnchorSeparator}{childName}";
|
||||
if (IsPartialMatch(full, partial)) results.Add(full);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace HavenSoft.HexManiac.Core.Models {
|
||||
public class SearchByte : ISearchByte {
|
||||
private readonly byte value;
|
||||
public SearchByte(int value) => this.value = (byte)value;
|
||||
public static explicit operator SearchByte (byte value) => new SearchByte(value);
|
||||
public static explicit operator SearchByte(byte value) => new SearchByte(value);
|
||||
public bool Match(byte value) => value == this.value;
|
||||
}
|
||||
public class PCSSearchByte : ISearchByte {
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
get => useTableEntryHeaders;
|
||||
set {
|
||||
if (!TryUpdate(ref useTableEntryHeaders, value)) return;
|
||||
foreach(var tab in tabs) {
|
||||
foreach (var tab in tabs) {
|
||||
if (tab is ViewPort viewModel) viewModel.UseCustomHeaders = useTableEntryHeaders;
|
||||
}
|
||||
}
|
||||
@@ -500,7 +500,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
var args = (ExtendedPropertyChangedEventArgs)e;
|
||||
var oldHeight = (int)args.OldValue;
|
||||
var height = viewPort2.Height;
|
||||
foreach(var tab in this) {
|
||||
foreach (var tab in this) {
|
||||
if (tab == viewPort2) continue;
|
||||
if (!(tab is IViewPort viewPort3)) continue;
|
||||
RemoveContentListeners(tab);
|
||||
|
||||
@@ -544,7 +544,6 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
var parallelLock = new object();
|
||||
var currentChange = history.CurrentChange;
|
||||
Parallel.ForEach(searchResults, result => {
|
||||
// foreach (var result in searchResults) {
|
||||
var nextRun = Model.GetNextRun(result);
|
||||
if (nextRun.Start < result) return;
|
||||
if (nextRun.Start == result && !(nextRun is NoInfoRun)) return;
|
||||
@@ -1114,7 +1113,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
|
||||
var visitedNames = new List<string>();
|
||||
while (arrayRun.LengthFromAnchor != string.Empty) {
|
||||
if (visitedNames.Contains(arrayRun.LengthFromAnchor)){
|
||||
if (visitedNames.Contains(arrayRun.LengthFromAnchor)) {
|
||||
// We kept going up the chain of tables but didn't find a top table. Either the table length definitions are circular or very deep.
|
||||
OnError?.Invoke(this, $"Could not extend table safely. Table length has a circular dependency involving {arrayRun.LengthFromAnchor}.");
|
||||
return;
|
||||
@@ -1140,7 +1139,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
newRun = newRun.Append(1);
|
||||
Model.ObserveRunWritten(history.CurrentChange, newRun);
|
||||
|
||||
foreach(var child in GetDependantArrays(newRun)) {
|
||||
foreach (var child in GetDependantArrays(newRun)) {
|
||||
ExtendArrayAndChildren(child);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,11 +85,11 @@ namespace HavenSoft.HexManiac.Tests {
|
||||
|
||||
var address = model.GetAddressFromAnchor(noChange, -1, "items");
|
||||
var run = (ArrayRun)model.GetNextAnchor(address);
|
||||
if (game.Contains("Emerald")) Assert.Equal(377, run.ElementCount);
|
||||
if (game.Contains("FireRed")) Assert.Equal(375, run.ElementCount);
|
||||
if (game.Contains("Emerald")) Assert.Equal(377, run.ElementCount);
|
||||
if (game.Contains("FireRed")) Assert.Equal(375, run.ElementCount);
|
||||
if (game.Contains("LeafGreen")) Assert.Equal(375, run.ElementCount);
|
||||
if (game.Contains("Ruby")) Assert.Equal(349, run.ElementCount);
|
||||
if (game.Contains("Sapphire")) Assert.Equal(349, run.ElementCount);
|
||||
if (game.Contains("Ruby")) Assert.Equal(349, run.ElementCount);
|
||||
if (game.Contains("Sapphire")) Assert.Equal(349, run.ElementCount);
|
||||
}
|
||||
|
||||
[SkippableTheory]
|
||||
@@ -100,11 +100,11 @@ namespace HavenSoft.HexManiac.Tests {
|
||||
|
||||
var address = model.GetAddressFromAnchor(noChange, -1, "trainerclassnames");
|
||||
var run = (ArrayRun)model.GetNextAnchor(address);
|
||||
if (game.Contains("Emerald")) Assert.Equal(67, run.ElementCount);
|
||||
if (game.Contains("FireRed")) Assert.Equal(108, run.ElementCount);
|
||||
if (game.Contains("Emerald")) Assert.Equal(67, run.ElementCount);
|
||||
if (game.Contains("FireRed")) Assert.Equal(108, run.ElementCount);
|
||||
if (game.Contains("LeafGreen")) Assert.Equal(108, run.ElementCount);
|
||||
if (game.Contains("Ruby")) Assert.Equal(59, run.ElementCount);
|
||||
if (game.Contains("Sapphire")) Assert.Equal(59, run.ElementCount);
|
||||
if (game.Contains("Ruby")) Assert.Equal(59, run.ElementCount);
|
||||
if (game.Contains("Sapphire")) Assert.Equal(59, run.ElementCount);
|
||||
}
|
||||
|
||||
[SkippableTheory]
|
||||
|
||||
@@ -210,11 +210,13 @@ namespace HavenSoft.HexManiac.Tests {
|
||||
public void GotoAutoCompleteNavigationCommandsWork() {
|
||||
var tab = new StubViewPort {
|
||||
Goto = new StubCommand { CanExecute = ICommandExtensions.CanAlwaysExecute },
|
||||
Model = new StubDataModel { GetAutoCompleteAnchorNameOptions = str => new List<string> {
|
||||
"Option 1",
|
||||
"Option 2",
|
||||
"Option 3",
|
||||
} },
|
||||
Model = new StubDataModel {
|
||||
GetAutoCompleteAnchorNameOptions = str => new List<string> {
|
||||
"Option 1",
|
||||
"Option 2",
|
||||
"Option 3",
|
||||
}
|
||||
},
|
||||
};
|
||||
var viewModel = new GotoControlViewModel(tab);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user