forked from Lounek09/DofusFlashGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapKey.cs
51 lines (41 loc) · 1.14 KB
/
MapKey.cs
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
using System.Text.Json.Serialization;
namespace DofusFlashGenerator.Models;
public sealed class MapKey : IData
{
public const string API_URL = "";
[JsonPropertyName("mapId")]
public int Id { get; init; }
[JsonPropertyName("date")]
public string Date { get; init; }
[JsonPropertyName("key")]
public string Key { get; init; }
[JsonPropertyName("crackedKey")]
public string CrackedKey { get; init; }
[JsonConstructor]
internal MapKey()
{
Date = string.Empty;
Key = string.Empty;
CrackedKey = string.Empty;
}
public bool IsCracked()
{
return string.IsNullOrEmpty(Key);
}
public string ToFlashXml()
{
return $"""
<invoke name="loadMap" returntype="xml">
<arguments>
<number>{Id}</number>
<string>{Date}</string>
<string>{(IsCracked() ? CrackedKey : Key)}</string>
</arguments>
</invoke>
""";
}
public string GetSwfFileName()
{
return $"{Id}_{Date}X.swf";
}
}