Big project cleanup with overhaul of file responsibilities (KISS) and code (DRY, YAGNI)

This commit is contained in:
2026-05-14 11:17:02 +02:00
parent bd6cdeb97b
commit 300c8f5a42
54 changed files with 2030 additions and 1745 deletions
+5 -4
View File
@@ -29,12 +29,13 @@ public class ItemData
public string GetReadableName()
{
string noUnderscore = Id.Replace("_", " ").ToLower();
return char.ToUpper(noUnderscore[0]) + noUnderscore.Substring(1);
return GetReadableName(Id);
}
public static string GetReadableName(string input)
{
if (string.IsNullOrEmpty(input)) return "";
string noUnderscore = input.Replace("_", " ").ToLower();
return char.ToUpper(noUnderscore[0]) + noUnderscore.Substring(1);
}
@@ -46,6 +47,8 @@ public class ItemData
public string GetCraftingDisplay()
{
if (Inputs.Count <= 0) return GetReadableName() + ": \r";
string result = GetReadableName() + ": \r";
foreach (Ingredient ingredient in Inputs)
@@ -53,8 +56,6 @@ public class ItemData
result += $"{GetReadableName(ingredient.Item)} ({ingredient.Amount}),\r";
}
if (Inputs.Count <= 0) return result;
result = result.Remove(result.Length - 2);
return result;
}