Skip to content

Commit

Permalink
Removed unnecessary enum translation function
Browse files Browse the repository at this point in the history
  • Loading branch information
Shushishtok committed Sep 23, 2024
1 parent 54874d4 commit 3f3b804
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/TSMapEditor/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,8 @@ public static IEnumerable<Point2D> GetFillAreaTiles(MapTile targetTile, Map map,
/// <returns>New name after it was converted to the desired difficulty.</returns>
public static string ConvertNameToNewDifficulty(string name, Difficulty fromDifficulty, Difficulty toDifficulty)
{
string fromDifficultyString = Helpers.GetDifficultyString(fromDifficulty);
string toDifficultyString = Helpers.GetDifficultyString(toDifficulty);
string fromDifficultyString = fromDifficulty.ToString();
string toDifficultyString = toDifficulty.ToString();

string newName = name.Replace(fromDifficultyString, toDifficultyString);
newName = newName.Replace($" {fromDifficultyString[0]}", $" {toDifficultyString[0]}");
Expand All @@ -606,22 +606,6 @@ public static string ConvertNameToNewDifficulty(string name, Difficulty fromDiff
return newName;
}

/// <summary>
/// Takes a difficulty enum and converts it into a string.
/// </summary>
/// <param name="difficulty">Difficulty enum to convert to string</param>
/// <returns>The string value of the enum.</returns>
public static string GetDifficultyString(Difficulty difficulty)
{
return difficulty switch
{
Difficulty.Easy => "Easy",
Difficulty.Medium => "Medium",
Difficulty.Hard => "Hard",
_ => "Invalid"
};
}

/// <summary>
/// Generates outline edges for a foundation of cells
/// </summary>
Expand Down

0 comments on commit 3f3b804

Please sign in to comment.