/// <summary> /// Either update or add the region to the specified game id /// </summary> /// <param name="gameId">Specifies the <see cref="ModsData.ModItem.GameId" /></param> /// <param name="region">Specifies the Game Region</param> public void UpdateGameRegion(string gameId, string region) { var gameIdIndex = GameRegions.FindIndex(x => string.Equals(x.GameId, gameId, StringComparison.OrdinalIgnoreCase)); if (gameIdIndex == -1) { GameRegions.Add(new GameRegion(gameId, region)); } else { GameRegions[gameIdIndex].Region = region; } }
/// <summary> /// Gets the user's saved game region for the specified <see cref="ModsData.ModItem.GameId" /> /// </summary> /// <param name="gameId">Game Id</param> /// <returns>Game Region</returns> public string GetGameRegion(string gameId) { return(GameRegions.FirstOrDefault(region => region.GameId.Equals(gameId, StringComparison.OrdinalIgnoreCase))?.Region); }