-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapModels.cs
More file actions
65 lines (58 loc) · 1.71 KB
/
Copy pathMapModels.cs
File metadata and controls
65 lines (58 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
namespace MapDownloader
{
[Serializable]
public class MapEntry
{
public string Name;
public string URL;
public string Hash;
}
public enum MapProcessResult
{
Skipped,
Downloaded,
VerificationFailed,
Unreachable,
Failed
}
public enum MapDownloadStatus
{
AllCurrent,
DownloadedSuccessfully,
CompletedWithErrors
}
public struct MapDownloadResult
{
public bool Success;
public MapDownloadStatus Status;
public List<string> FailedMaps;
public int DownloadedCount;
public int SkippedCount;
public static MapDownloadResult AllCurrent(int skippedCount) => new MapDownloadResult
{
Success = true,
Status = MapDownloadStatus.AllCurrent,
FailedMaps = new List<string>(),
DownloadedCount = 0,
SkippedCount = skippedCount
};
public static MapDownloadResult AllGood(int downloadedCount, int skippedCount) => new MapDownloadResult
{
Success = true,
Status = MapDownloadStatus.DownloadedSuccessfully,
FailedMaps = new List<string>(),
DownloadedCount = downloadedCount,
SkippedCount = skippedCount
};
public static MapDownloadResult WithErrors(List<string> failed, int downloadedCount, int skippedCount) => new MapDownloadResult
{
Success = false,
Status = MapDownloadStatus.CompletedWithErrors,
FailedMaps = failed,
DownloadedCount = downloadedCount,
SkippedCount = skippedCount
};
}
}