mirror of
https://github.com/CommonLoon102/NBloodServerSupervisor.git
synced 2024-12-22 10:42:54 +01:00
change IList to IReadOnlyList (#21)
This commit is contained in:
parent
506ca164fd
commit
9f18b6365c
@ -11,7 +11,7 @@ namespace WebInterface.Services
|
||||
{
|
||||
public class CustomMapService : ICustomMapService
|
||||
{
|
||||
private static readonly List<string> crypticMaps = new List<string>()
|
||||
private static readonly IReadOnlyList<string> crypticMaps = new List<string>()
|
||||
{
|
||||
"CPSL.MAP",
|
||||
"CP01.MAP",
|
||||
@ -29,14 +29,14 @@ namespace WebInterface.Services
|
||||
"CPBB04.MAP",
|
||||
};
|
||||
|
||||
private List<string> ListableCustomMaps => Directory.GetFiles(CommandLineUtils.BloodDir)
|
||||
private IReadOnlyList<string> ListableCustomMaps => Directory.GetFiles(CommandLineUtils.BloodDir)
|
||||
.Select(m => Path.GetFileName(m))
|
||||
.Where(m => m.ToUpper().EndsWith(".MAP"))
|
||||
.Where(m => !ContainsString(crypticMaps, m))
|
||||
.OrderBy(m => m)
|
||||
.ToList();
|
||||
|
||||
public IList<string> ListCustomMaps() => ListableCustomMaps;
|
||||
public IReadOnlyList<string> ListCustomMaps() => ListableCustomMaps;
|
||||
|
||||
public byte[] GetCustomMapBytes(string map)
|
||||
{
|
||||
|
@ -2,13 +2,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebInterface.Services
|
||||
{
|
||||
public interface ICustomMapService
|
||||
{
|
||||
IList<string> ListCustomMaps();
|
||||
IReadOnlyList<string> ListCustomMaps();
|
||||
byte[] GetCustomMapBytes(string map);
|
||||
string StoreTempCustomMap(IFormFile formFile);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
@model List<string>
|
||||
@model IReadOnlyList<string>
|
||||
@{
|
||||
ViewData["Title"] = "Custom Maps";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
|
Loading…
Reference in New Issue
Block a user