Skip to content

Commit

Permalink
Add Island env resize for NoStadium
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBang1112 committed Aug 27, 2024
1 parent 16935fd commit 26742ac
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions Src/NationsConverter/DecorationConverter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.Engines.Game;
using Microsoft.Extensions.Logging;
using Microsoft.VisualBasic;
using NationsConverterShared.Models;
using System.Text.RegularExpressions;

Expand All @@ -12,10 +10,8 @@ internal sealed partial class DecorationConverter
private readonly CGameCtnChallenge map;
private readonly CGameCtnChallenge convertedMap;
private readonly NationsConverterConfig config;
private readonly ILogger logger;

private readonly string environment;
private readonly ConversionSetModel conversionSet;

[GeneratedRegex(@"(Sunrise|Day|Sunset|Night)")]
private static partial Regex MoodRegex();
Expand All @@ -25,26 +21,13 @@ public DecorationConverter(CGameCtnChallenge map, CGameCtnChallenge convertedMap
this.map = map;
this.convertedMap = convertedMap;
this.config = config;
this.logger = logger;

environment = map.GetEnvironment() switch
{
"Alpine" => "Snow",
"Speed" => "Desert",
_ => map.GetEnvironment()
};

conversionSet = environment switch
{
"Snow" => config.Snow,
"Rally" => config.Rally,
"Desert" => config.Desert,
"Island" => config.Island,
"Bay" => config.Bay,
"Coast" => config.Coast,
"Stadium" => config.Stadium, // should not be always Solid category
_ => throw new ArgumentException("Environment not supported")
};
}

public void Convert()
Expand All @@ -55,6 +38,11 @@ public void Convert()
? "NoStadium48x48"
: "48x48Screen155";

if (environment == "Island")
{
convertedMap.Size = new(90, 36, 90);
}

convertedMap.Decoration = new($"{mapBase}{mood}", 26, "Nadeo");

if (config.IncludeDecoration)
Expand Down

0 comments on commit 26742ac

Please sign in to comment.