mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Rename DatItemTool to Setter
This commit is contained in:
@@ -99,7 +99,7 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
if (datItemMappings.ContainsKey(DatItemField.Type))
|
if (datItemMappings.ContainsKey(DatItemField.Type))
|
||||||
{
|
{
|
||||||
DatItem datItem = DatItem.Create(datItemMappings[DatItemField.Type].AsItemType());
|
DatItem datItem = DatItem.Create(datItemMappings[DatItemField.Type].AsItemType());
|
||||||
DatItemTool.SetFields(datItem, datItemMappings, machineMappings);
|
Setter.SetFields(datItem, datItemMappings, machineMappings);
|
||||||
datItem.Source = new Source(indexId, filename);
|
datItem.Source = new Source(indexId, filename);
|
||||||
ParseAddHelper(datItem, statsOnly);
|
ParseAddHelper(datItem, statsOnly);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace SabreTools.DatItems
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set fields on DatItems
|
/// Set fields on DatItems
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class DatItemTool
|
public static class Setter
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set fields with given values
|
/// Set fields with given values
|
||||||
@@ -133,7 +133,7 @@ namespace SabreTools.Filtering
|
|||||||
|
|
||||||
foreach (var datItem in datItems)
|
foreach (var datItem in datItems)
|
||||||
{
|
{
|
||||||
DatItemTool.SetFields(datItem.Machine, mappings);
|
Setter.SetFields(datItem.Machine, mappings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ namespace SabreTools.Filtering
|
|||||||
|
|
||||||
foreach (var datItem in datItems)
|
foreach (var datItem in datItems)
|
||||||
{
|
{
|
||||||
DatItemTool.SetFields(datItem, mappings, null);
|
Setter.SetFields(datItem, mappings, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ using Xunit;
|
|||||||
|
|
||||||
namespace SabreTools.Test.DatItems
|
namespace SabreTools.Test.DatItems
|
||||||
{
|
{
|
||||||
public class DatItemToolTests
|
public class SetterTests
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public void SetFieldsDatItemTest()
|
public void SetFieldsDatItemTest()
|
||||||
{
|
{
|
||||||
var datItem = CreateDatItem();
|
var datItem = CreateDatItem();
|
||||||
var mappings = new Dictionary<DatItemField, string> { [DatItemField.Name] = "bar" };
|
var mappings = new Dictionary<DatItemField, string> { [DatItemField.Name] = "bar" };
|
||||||
DatItemTool.SetFields(datItem, mappings, null);
|
Setter.SetFields(datItem, mappings, null);
|
||||||
Assert.Equal("bar", datItem.GetName());
|
Assert.Equal("bar", datItem.GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ namespace SabreTools.Test.DatItems
|
|||||||
{
|
{
|
||||||
var datItem = CreateDatItem();
|
var datItem = CreateDatItem();
|
||||||
var mappings = new Dictionary<MachineField, string> { [MachineField.Name] = "foo" };
|
var mappings = new Dictionary<MachineField, string> { [MachineField.Name] = "foo" };
|
||||||
DatItemTool.SetFields(datItem, null, mappings);
|
Setter.SetFields(datItem, null, mappings);
|
||||||
Assert.Equal("foo", datItem.Machine.Name);
|
Assert.Equal("foo", datItem.Machine.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user